Forum Moderators: phranque

Message Too Old, No Replies

slash after file name of a url causes issues

         

fantalimon

4:36 pm on Jun 20, 2011 (gmt 0)

10+ Year Member



using rhel 5.5 with apache 2.2.17 and php 5.3.6
A slash after a file name and any random letters after it does not go to the custom 404 page but displays the page without formatting.

For example
www.example.com/about-us/example.html/ displays correctly
www.example.com/about-us/example.html/ndfjslj displays the same example.html page but without the formatting but i would expect this to server the custom 404 page.

I have tried with rewrites to fix this issue but it has not worked. Can anyone please guide me the right direction? Thanks

g1smd

4:44 pm on Jun 20, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Turn off AcceptPathInfo in the Options.

You'll need to set up redirects to the canonical URL if any of the duff URLs have been indexed by searchengines (or ensure that "410 Gone" is sent).

URLs for pages do NOT end with a trailing slash.

URLs with a trailing slash are reserved for folders and the index page in a folder.

fantalimon

9:04 am on Jun 21, 2011 (gmt 0)

10+ Year Member



Thank you for your advice. I have added AcceptPathInfo Off in the Options and all is working as it should. I wonder why this is not a default part of the httpd.conf file?

g1smd

9:58 am on Jun 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is the default for many sites, but some hosts turn it on to "reduce the number of support questions". Some sites don't work without it.