Reputation: 13521
I have this URL pointing my web site:
http://www.mysite.ext/.htaccess.aspx-->/
and I like to redirected to
http://www.mysite.ext/
but I can't.
In my .htaccess file I have enter this rule:
RewriteRule ^(.htaccess(.+))/?$ http://www.mysite.ext/? [R=301,L]
but doesn't work
also I have try the following:
RewriteRule ^(\.htaccess\.aspx(.*))/?$ http://www.mysite.ext/? [R=301,L]
but still no luck. I don't know if that helps, but the site is based on PHP.
Any idea please ?
Is it realy so hard ?
Can somebody to help me please ?
Upvotes: 1
Views: 101
Reputation: 786291
Not sure how you are you getting requests for /.htaccess.aspx
and why you want to redirect them.
However keep in mind that Apache configs usually block access to .htaccess
using directive like below:
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
That throws 403 (Forbidden) error for any request that starts with /.ht
.
Workaround:
Have a custom handler for 403:
ErrorDocument 403 /errorPage403.php
and have this redirect rule:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+\.htaccess\.aspx [NC]
RewriteRule ^ /? [L,R]
Upvotes: 1