Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Forward slash afterfilename


alhermette - 2:47 pm on Apr 12, 2012 (gmt 0)


I just noticed in my logs that there are requests where a forward slash and additional directories/parameters have been added. The odd thing is that the server is returning a 200 status code instead of a 404.

I'm not sure that it is an .htaccess problem but here's my current code in there:

ErrorDocument 404 /common/errors/404.php

IndexIgnore *
Options All
Options +FollowSymLinks -Indexes

RewriteEngine On

# Force www
RewriteCond %{HTTP_HOST} ^(example\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

# Remove index file
RewriteCond %{THE_REQUEST} \ /(.+/)?index\.(php|html)(\?.*)?\ [NC]
RewriteRule ^(.+/)?index\.(php|html)$ /$1 [NC,R=301,L]


Can anyone shed any light as to how I can convince my server to throw a 404 for requests like this:

mydomain.com/index.php/Russia.php?x=blue-widgets/Russia.php

[edited by: incrediBILL at 8:41 pm (utc) on Apr 12, 2012]
[edit reason] exemplified URLs [/edit]


Thread source:: http://www.webmasterworld.com/apache/4440042.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com