re-write solution

Fix it!!

re-write solution

Postby frankie_27 » Thu Dec 09, 2004 7:56 pm

I am wondering if anyone can help with this problem.

I am running ssi pages on my site, and if I type in a incorrect file name I get a 404 not found error.
But if I type a /.file_name to the end of a *.shtml file
like: http://www.morelboys.com/news.shtml/.no404
Apache will try to load this without a 404 error

but if I change the file to news.html Apache shows an error.

So I am assuming this is because *.shtml are server side executable?

So I have checked other sites that use SSI and some will act like my site, while others will generate a 404.

Maybe I am wrong but I was thinking about adding a RewriteCond to
look for anything after the *.shtml file
and then a RewriteRule to send that request to a 403 page or?

How would this be done?

thanks in advance
frankie_27
 
Posts: 2
Joined: Thu Dec 09, 2004 7:43 pm

Postby Caterham » Fri Dec 10, 2004 2:19 pm

Maybe I am wrong but I was thinking about adding a RewriteCond to
look for anything after the *.shtml file
and then a RewriteRule to send that request to a 403 page or?

Code: Select all
RewriteEngine On
RewriteRule ^.+\.shtml/.+ - [F]
:P
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby frankie_27 » Fri Dec 10, 2004 3:03 pm

thanks that did it!
frankie_27
 
Posts: 2
Joined: Thu Dec 09, 2004 7:43 pm


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 11 guests

cron