I cant understand how to redirect to the parent directory in this case:
I have a root directory with .htaccess file, where rewriteEngine is on. In this directory I have a file rootFile.php.
Also, in this directory I have a directory "forum", with another .htaccess file in it.
When there is request to "forum.mySite.com/rootFile.php", I need to redirect it to "mySite.com/rootFile.php" which means I need to redirect request to the parent directory.
/forum/.htaccess:
RewriteEngine on
RewriteBase /forum/
RewriteRule ^sitemap /forum/map.php [L]
...
I tried to:
RewriteEngine on
RewriteBase /forum/
RewriteRule ^rootFileName ../rootFile.php [L]
# or so RewriteRule ^rootFileName /rootFile.php [L]
# or so RewriteRule ^rootFileName rootFile.php [L]
RewriteRule ^sitemap /forum/map.php [L]
Also tried this one:
RewriteEngine on
RewriteBase /
RewriteRule ^rootFileName ../rootFile.php [L]
# or so RewriteRule ^rootFileName /rootFile.php [L]
# or so RewriteRule ^rootFileName rootFile.php [L]
RewriteBase /forum/
RewriteRule ^sitemap /forum/map.php [L]
And it always redirect from /forum/rootFileName to /forum/rootFile, but never to /rootFile.
Where is my mistake?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…