sfdeveloper
sfdeveloper

Reputation: 196

mod_rewrite rewrite url using .htaccess php

I am new to htaccess rules.

I want a rule that will treat two urls as one.

This two should be treated as same URL. I just want to add sites/client1 to URL which actually does nothing. Every URL request should contain sites/client1/.

For next request like

Thanks for any help.

Upvotes: 1

Views: 72

Answers (2)

user2193789
user2193789

Reputation:

This will send all request in /sites/client1/ to /

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^sites/client1/(.*)$ $1 [L,QSA]
</IfModule>

Upvotes: 1

0xmtn
0xmtn

Reputation: 2670

Try this:

RewriteRule index.php?(.*) sites/client1/index.php?$1

Also please search around a bit before posting here. Some possible duplicates of this question are these:

.htaccess URL rewrite with one and two query string vars

htaccess url rewrite to .php

Upvotes: 1

Related Questions