simple I want to redirect anything that comes in on my home url that is a word or _
- Code: Select all
\w
and between 8 and 16 characters to a sub folder, but there are certain names that fit this description that i dont wish to redirect
so i want www.example.com/great_stuff
to go to a folder that exists in my web root called /great_stuff (as would normally happen)
and www.example.com/otherthingy
which is a folder that doesnt exist in my web root but matches the rewrite conditions of
- Code: Select all
[\w]{8,16}
/subfolder/otherthingy but in the url shows www.example.com/otherthingy
so to redirect i have
- Code: Select all
RewriteRule ^/([\w]{8,16})/?$ /subfolder/$1/index.php [L]
but I cant get my head around how to say not redirect for the value
"brilliant" "excellent" "another_one" or any others
- Code: Select all
RewriteRule ^/((^brilliant|excellent|another_one)[\w]{8,16})/?$ /subfolder/$1/index.php [L]
- Code: Select all
RewriteRule ^/(!(brilliant|excellent|another_one)[\w]{8,16})/?$ /subfolder/$1/index.php [L]
these arnt working and my logs are showing its trying to look in the subfolder redirect please can you point me in the right direction I have gone all fuzzy on this (maybe i shouldnt be trying this on a sunday)
I also have a feeling this has something to do with a rewrite condition
- Code: Select all
RewriteCond %{REQUEST_FILENAME} !-d
but if i create
- Code: Select all
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([\w]{8,16})/?$ /subfolder/$1/index.php [L]
as i understand this says if the directory doesnt exist then perform this rule - otherwise skip it?
Bit frustrated on this and could do with some light being shed on it -Thanks in advance for any pointers