Reputation: 153
I would like to implement a pattern in htacces to change the url to a specific pattern. My main file is dashboard.php. One GET variable is constant and another are optional. Here is an example illustrating my idea:
dashboard.php?view=foo&var1=bar&var2=something
Redirects to
dashboard/foo?var1=bar&var2=something
I'm not good at writing conditions to .htacces.
Thank you for any help you can give.
Upvotes: 0
Views: 32
Reputation: 784958
You can use this rule in your site root .htaccess:
Optiona -MultiViews
RewriteEngine On
RewriteRule ^(dashboard)/([\w-]+)/?$ $1.php?view=$2 [L,QSA,NC]
Upvotes: 1