I'm trying to use mod_rewrite to achieve the following rewrite:
From - http:// pre.domain.com/public/?project=Awesome
To - http:// pre.domain.com/project/Awesome
Can't seem to figure it out (despite reading through endless sites). Any help?
I'm trying to use mod_rewrite to achieve the following rewrite:
From - http:// pre.domain.com/public/?project=Awesome
To - http:// pre.domain.com/project/Awesome
Can't seem to figure it out (despite reading through endless sites). Any help?
RewriteEngine On
RewriteCond %{QUERY_STRING} ^project=(.*)$
RewriteRule ^/public/ /project/%1/? [R,L] # strip off query string
You need to match against the query string using a RewriteCond.
Not sure you have your URLs around the right way so I think your are trying to do this:
RewriteRule ^project/(Awesome) /public/?project=$1 [L]