Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problems with htaccess redirects
 
davincia
Jr. Member
 
Total Posts:  17
Joined:  2010-10-17
 

I\’m doing some testing with my sites .htaccess file to block malicious attacks such as if a request comes in for http://mysite.com/somepage.html//malicious_attempt.php

So for these attempts I want to serve a 403 error instead of the 404.

In my root .htaccess file I add the following

<IfModule mod_alias.c>
RedirectMatch 403 \/\/
</
IfModule>

This is not working any 403 error still gets redirected to the 404 page. Even if I change the string to try and match anything on my site such as a legitimate page, instead of receiving a 403 error it gets directed to a 404.

Even if I try a RewriteRule using the [F,L] flags it still gets directed to a 404.

Anyone have any suggestions?
Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top