Kalpit
Kalpit

Reputation: 4936

.htaccess url rewriting issue - redirecting every request to sub directory

i have following htaccess file which redirecting every link to /love/tribe-world directory (including root also).

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (?!^/campaigners/)^(.*)$ /love/tribe-world/campaigners/$1 [L,QSA] 

i have written above rules for hiding /love/tribe-world directory from url. i wanted url www.example.com/campaigners/start-process instead www.example.com/love/tribe-world/campaigners/start-process, which is working using above rule.

But its redirecting every request to the /love/tribe-world which is strength for me.

Can anyone guide me what i am doing wrong here...

Thanks in advance

Upvotes: 1

Views: 61

Answers (1)

anubhava
anubhava

Reputation: 785631

Your lookahead is incorrect. Use this rule:

RewriteEngine on

RewriteRule ^(campaigners.*)$ /love/tribe-world/$1 [L,NC] 

Upvotes: 1

Related Questions