0

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

2 Answers 2

1

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]
Sign up to request clarification or add additional context in comments.

Comments

0

You could modify your rewrite cond to:

RewriteCond %{QUERY_STRING} !(^client|^$)

1 Comment

ah when i changed it shows 404 on domain.com/5iWxD0GZVVk so it means it is not redirecting it .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.