: Apache redirecting: reason unknown I have a simple php script. The script is not important. It just prints out $_SERVER. When I request an URL like www.server.com/?ref=bar everything is fine.
I have a simple php script. The script is not important. It just prints out $_SERVER.
When I request an URL like server.com/?ref=bar everything is fine.
However if the request contains something like server.com/?ref=http://www.test.com (?ref=http%3A%2F%2Fwww.test.com) the server redirects to 403.shtml.
No redirect for x but redirects x.y
As far as I can understand somehow the server doesn't like "http://x". It always redirects to 403.shtml when there is a valid query string in the form of a valid url.
my .htacess file is the same both on my server and local test server and local test server behaves as expected (no redirects). So I don't it is related to .htaccess.
I'm on shared host on Hostgator. Can anyone help?
Edit:
Here's the .htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php? [L,QSA]
When there is an xx.x it redirects to 403 even if there is physical file. However if I remove the .htaccess redirect to 403 also disappears. But I need the above .htaccess file. Is there a way to get around this?
More posts by @Ann8826881
1 Comments
Sorted by latest first Latest Oldest Best
I would guess Hostgator are using the Apache module mod_security, which will block any request that looks like a hacking attempt. You'll either have to change your script so it doesn't pass a URL in the query string or contact them to see if they can tweak their setup.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.