Forum Moderators: phranque
My .htacess seems to be working in every cases excepted when I put "index/index" in the URL. Indeed, when I call $_SERVER['REQUEST_URI']" from PHP with a URL other than "basesite/dir/index/index", everything after "basesite/dir" is returned, but with "/index/index" it returns "basesite/dir/index/index" and eventually everything after.
Per example, I type "localhost/~dirperso/test/contact/view/id/1". It will return "/contact/view/id/1".
But when it is "localhost/~dirperso/test/index/index/style/1", the var returns "/~dirperso/test/index/index/style/1".
My .htaccess file is like this :
RewriteEngine on
RewriteBase /~dirperso/test
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule!\.(js¦ico¦gif¦jpg¦png¦css)$ index.php It is in the "test" directory.
Has someone a solution to propose?
Thanks.
EDIT : Oh, I've just read somewhere that the server may try to bypass the .htaccess by trying to call the file related to the first keyword. Can it be related?
EDIt 2 : I've just created a file called "inde.php". I tried to call the URL "/~dirperso/test/inde/whatever". If the .htaccess worked normally, the $_SERVER['REQUEST_URI'] should have been returned. But nothing was returned, as if "inde.php" was called instead of "index.php". Then I deleted it, refreshed the browser and the var returned something.