Reputation: 1996
I have a few problems with my mod_rewrite rules. There a three different url pattern I want to handle.
The following mod_rewrite rules don't really work. Also I've the problem that the query (example: user.html?foo=bar) doesn't have an effect.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([0-9A-Za-z_-]*)/?([0-9A-Za-z_]+)-?([0-9A-Za-z_,]*)\.html$ index.php?__module=$1&__view=$2&__argv=$3
RewriteRule ^([0-9A-Za-z_-]*)/?$ index.php?__module=$1&__view=&__argv=
</IfModule>
Upvotes: 0
Views: 208
Reputation: 3725
For the query string, flag your rules with QSA (Query String Append).
What you are trying to configure is called a "front controller", of which there are already quite a lot ready-made. Maybe you should have a look at some popular PHP frameworks and adopt one that suits you.
Upvotes: 3