first of, I'm new to things belonging Apache and ModRewrite especially - didn't need detailed knowledge about it until some weeks ago.
What I wanted to do: All folders beyond a certain level should be treated as GET-Variable. Why? I don't like URLs like
http://www.example.com/doit/index.php?level=admin&name=archer&file=archiv
- it would be nicer to have a URL like
http://www.example.com/doit/admin/archer/archiv
and then letting Apache do the internal rewritings which then are used by my PHP-Script.
OK, I started on it - and it worked. But - not everytime. And now that's the problem:
My folderstructure is like this:
www.example.com/doit/
My htaccess-File is located in /doit/ and contains the following code:
- Code: Select all
RewriteEngine on
RewriteRule !^img(.*)$ - [C]
RewriteRule ^(.*)\/ index.php?param=$1 [L]
So everytime I have a link like "www.example.com/doit/admin/archer/"
my PHP-Script get's a variable $_GET['param'] containing "admin/archer".
Works quite fine ...
... until a URL sounds like "www.example.com/doit/doit/archer/" - having the folder and virtual subfolder both sounding alike ("doit")
In this case my PHP-Script get's a variable $_GET['param'] containing "doit.php/archer"
Now my big question: WHY? Why does RewriteEngine add a ".php" to my "doit" ?
thx in advance..
mard