All requests to my site should be rewritten to index.php?page=blahwhere the blah page is requested (except for css, js, jp (e) g, gif and png files).
This is what my .htaccess file looks like:
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
.htaccess is in this directory: localhost:8080/example/so when I go to localhost:8080/example/abcit is (internally) rewritten to localhost:8080/example/index.php?page=abc.
However, when I go to localhost:8080/example/res, I redirect to localhost:8080/example/res/?page=res. I found out that this only happens with directories; when I go to localhost:8080/example/core(also to a folder in my file system), I get redirected to localhost:8080/example/core/?page=corewhile it should be internally rewritten to localhost:8080/example/index.php?page=core, and the URL visible to the user should remainlocalhost:8080/example/core/
EDIT:
@w3dk, , . , :
:
localhost:8080/example/index/a, localhost:8080/example/index.php?page=index.php/a, localhost:8080/example/index.php?page=index/a.
, , index , , localhost:8080/example/exampleFile/abc, localhost:8080/example/index.php?page=exampleFile.php/abc, .
2 :
Apache, , php , , , File.txt