Magentix
if (OP.statement == false) postCount++;
- Reaction score
- 107
Basically I have these URLs:
domain.com
domain.com/directoryA
domain.com/directoryB
domain.com/directoryC
and I want domain.com to be redirected to domain.com/directoryA
yet directoryA, directoryB and directoryC should still be accessible directly.
I know how to redirect a directory to root, but how do I do it the other way around?
domain.com
domain.com/directoryA
domain.com/directoryB
domain.com/directoryC
and I want domain.com to be redirected to domain.com/directoryA
yet directoryA, directoryB and directoryC should still be accessible directly.
I know how to redirect a directory to root, but how do I do it the other way around?
Code:
# redirect directory to root
RewriteEngine on
RewriteRule ^(directoryname/.*) /index.php?path=$1 [NC,QSA]
# the other way around? this gives 500 error or infinite loop
RewriteCond %{path_info} ^$
RewriteRule ^(.*)$ /directoryA/$1 [NC,QSA]