Reputation: 33364
Can anyone spot what is wrong with this URL rewrite? I can't get it to pass anything to GET (the script loads, but no parameters are passed):
RewriteRule ^archive(/(.*))?$ archive.php?action=$1 [QSA,L]
I want to map "archive/browse/" to "archive.php?action=browse".
Upvotes: 1
Views: 107
Reputation: 61597
RewriteEngine On
RewriteRule ^archive/(.*)$ archive.php?action=$1 [QSA,L]
Would rewrite anything after /archive/
to archive.php?action=test/dir/path
Upvotes: 1
Reputation: 655785
You can get some conflicts when MultiViews is enabled. If it’s enabled, Apache first tries to find a file with a similar name to map the request to before passing it down to mod_rewrite. So a request of /archive/browse/
ends in /archive.php/browse/
before mod_rewrite can map it to your /archive.php?action=browse
.
Try to disable it with:
Options -MultiViews
Upvotes: 3