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 fi
You wrote:
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.
Did you mean:
When there is request to "mySite.com/forum/rootFile.php", I need to
redirect it to "mySite.com/rootFile.php" which means I need to
redirect request to the parent directory.
...Which in turn means:
When there is request to "/forum/rootFile.php", I need to
redirect it to "/rootFile.php" which means I need to
redirect request to the parent directory.
In your .htaccess in the /forum dir try this:
RewriteEngine On
RewriteRule ^rootFileName(.*) /rootFile.php [QSA,R=301,L]