I have three scenario to satisfy
Scenarios are
- Need to redirect if
www.example.comthen towww.example.com/a-a - Need to redirect if
www.example.com/pagesthen towww.example.com/a-a/pages - Need not to redirect if
www.example.com/b-bthen go as it iswww.example.com/b-b - Need not to redirect if
www.example.com/b-b/pagesthen go as it iswww.example.com/b-b/pages
My code is satisfying the first two scenarios and forcing always the same. I couldn't bring the not condition.
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/a-a(/.*)?$
RewriteRule ^(.*)$ /a-a/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/b-b(/.*)?$
RewriteRule ^(.*)$ [L,R=301] # do nothing here and not to do the previous condition
Second condition is forcing always to www.example.com/a-a/b-b I do not want this.