views:

16

answers:

2

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 ..

A: 

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]
igor
A: 

You could modify your rewrite cond to:

RewriteCond %{QUERY_STRING} !(^client|^$)
PP
ah when i changed it shows 404 on http://domain.com/5iWxD0GZVVk so it means it is not redirecting it .
Arsheep