Forum Moderators: mack
My problem is though after proper redirection in cpanel,whenever i click [forum.mysite.com...] or [mysite.com...] the page gets redirected to [mysite.com...]
Please help me asap
my .htaccess
file reads like this
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /home-page/
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /home-page/index.php [L]
</IfModule># END WordPress
RedirectMatch permanent ^/forum/index.php$ http://www.mysite.com/forum/index.php
RedirectMatch permanent ^/$ http://mysite.com/blog
I believe all you need is a "last" flag:
RedirectMatch permanent ^/forum/index.php$ http://www.mysite.com/forum/index.php [L]
RedirectMatch permanent ^/$ http://mysite.com/blog [L]
From our very own An Introduction to Redirecting URLs on an Apache Server [webmasterworld.com]:
The "L" flag tells apache that this is the last rule that it needs to process. It's not required in our simple example but, as your rules grow in complexity, it will become very useful. As your understanding of mod_rewrite deepens, you may add conditions to your rules (RewriteCond directive) and the "L" flag will tell apache that mod_rewrite can quit processing these conditions after performing the rewrite, IF the RewriteRule pattern is matched. Experts suggest that you get in the habit of including the "L" flag with every RewriteRule to avoid unpleasant surprises. As you gain experience, you may encounter situations where it's not needed. Experts assure me that these are very rare.