Reputation: 4323
Okay what i want to do is ...
http://domain.com/hdu79ejo
above should be redirected to
http://domain.com/client/?share=hdu79ejo
where hdu79ejo
can be any value.
But ...
http://domain.com/client
and
http://domain.com
should not be redirected at all.
Here is my code
RewriteEngine on
RewriteCond $1 !^(client)
RewriteRule ^(.*)$ /client/?share=$1 [L]
it works fine except http://domain.com
also getting redirected to http://domain.com/client/?share=
.
Thanks for help ..
Upvotes: 0
Views: 136
Reputation: 10864
You could modify your rewrite cond to:
RewriteCond %{QUERY_STRING} !(^client|^$)
Upvotes: 0
Reputation: 2100
You will have to add another RewriteCond
. Something like this should work (untested):
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/?$
RewriteCond %{REQUEST_URI} !^/client/?$
RewriteRule ^(.*)$ /client/?share=$1 [L]
Upvotes: 1