Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Server Configuration _ Some SSIs not working and no error generated

Posted by: wkgorey Jul 1 2019, 09:52 AM

SSI's on my index page work fine when it is found as the default page if I type estateagentsespana.com into browser address bar.

But if I type estateagentsespana.com/index.htm into the address bar, the SSIs are ignored. SSIs on other pages are also being ignored.

My htaccess:

QUOTE

<Files 403.shtml>
order allow,deny
allow from all
</Files>
AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .htm

<IfModule mod_rewrite.c>
RewriteEngine On

# redirect from non-www to www with https
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# redirect from http to https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>

Options -Indexes

ErrorDocument 404 /404.htm


Posted by: pandy Jul 1 2019, 10:49 AM

Looks alright to me. Standard method. unsure.gif

But I'm wondering about this bit.

CODE
<Files 403.shtml>
order allow,deny
allow from all
</Files>


Have you written that yourself? Have your site at some point been hacked? If you didn't put it there yourself, look for the mentioned php file.
https://security.stackexchange.com/questions/9708/index-page-has-been-compromised-suspicious-files-are-showing-up

Posted by: wkgorey Jul 1 2019, 11:28 AM

QUOTE(pandy @ Jul 1 2019, 05:49 PM) *

Looks alright to me. Standard method. unsure.gif

But I'm wondering about this bit.

CODE
<Files 403.shtml>
order allow,deny
allow from all
</Files>


Have you written that yourself? Have your site at some point been hacked? If you didn't put it there yourself, look for the mentioned php file.
https://security.stackexchange.com/questions/9708/index-page-has-been-compromised-suspicious-files-are-showing-up



I put that in myself - it was needed to use custom 403 error page. I'll take it out and see if that makes any difference

Posted by: pandy Jul 1 2019, 11:35 AM

Ah, it's OK then. I haven't seen that method before so I googled and found a lot of stuff about hacked sites. Sorry. No, it won't make a difference to take it out. I was just worried the server was compromised.

Posted by: Christian J Jul 1 2019, 12:19 PM

QUOTE(wkgorey @ Jul 1 2019, 04:52 PM) *

SSI's on my index page work fine when it is found as the default page if I type estateagentsespana.com into browser address bar.

But if I type estateagentsespana.com/index.htm into the address bar, the SSIs are ignored.

Double-check that estateagentsespana.com and estateagentsespana.com/index.htm is really the same file --maybe estateagentsespana.com actually loads an .shtml file? Or if estateagentsespana.com actually loads an .html file, double-check their inclusion file paths etc.

QUOTE
SSIs on other pages are also being ignored.

Does a test page with .shtml extension work? .html?

QUOTE

AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .htm

Can't say if that's correct, but in my experience, .htaccess directives for running PHP with .html extensions can be wildly different depending on how the server is set up.

Posted by: wkgorey Jul 1 2019, 02:01 PM

QUOTE(Christian J @ Jul 1 2019, 07:19 PM) *

QUOTE(wkgorey @ Jul 1 2019, 04:52 PM) *

SSI's on my index page work fine when it is found as the default page if I type estateagentsespana.com into browser address bar.

But if I type estateagentsespana.com/index.htm into the address bar, the SSIs are ignored.

Double-check that estateagentsespana.com and estateagentsespana.com/index.htm is really the same file --maybe estateagentsespana.com actually loads an .shtml file? Or if estateagentsespana.com actually loads an .html file, double-check their inclusion file paths etc.

QUOTE
SSIs on other pages are also being ignored.

Does a test page with .shtml extension work? .html?

QUOTE

AddType text/html .shtml
AddHandler server-parsed .html
AddHandler server-parsed .htm

Can't say if that's correct, but in my experience, .htaccess directives for running PHP with .html extensions can be wildly different depending on how the server is set up.


Good ideas re trying a test page - both .shtml and .html extensions work properly, so the issue seems to be with .htm extension.



Posted by: pandy Jul 1 2019, 03:32 PM

It seems to work now. What did you do?

Posted by: wkgorey Jul 2 2019, 05:00 AM

The problem is partially resolved. Web hosting support had a look and told me they'd fixed it, without telling me what the issue was. Strangely, I had to clear browser caches before I could get pages to display correctly.

Today, I loaded the index page, clicked a link, and then selected a link back to the index page, which did not display properly. Refreshing the page got it to load.

All a bit worrying since many visitors are not going to try reloading if they see virtually nothing on a page.

Posted by: pandy Jul 2 2019, 06:57 AM

Ah, that was how I discovered that it worked. I for some reason reloaded. When I wanted to check with other browsers if it worked when reloaded it turned out it worked straight off.

Strange. Wonder what it was. Must have to do with the .htm extension anyway.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)