How to 301 redirect forum to subdomain

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Postby SeO » Mon Jan 26, 2009 8:37 am

Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule ^forum/(.*)$$1 [R=301,L]

In the domain's root .htaccess should do it, at least, it should not go 404 if the path are correct.
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm


Re: How to 301 redirect forum to subdomain

Postby mariusbabtan » Sun Jun 06, 2010 8:12 am

I solved my problem by removing # from :

RewriteCond %{HTTP_HOST} !^www\.forum\.pariuri-x\.ro$ [NC]
RewriteRule ^(.*)$$1 [QSA,L,R=301]

I putted in mian htaccesss the 301 redirect didn't worked, i readed lot's of solution none work, after few test i resolved the problem like i sayed remove # from front of :

RewriteCond %{HTTP_HOST} !^www\.forum\.pariuri-x\.ro$ [NC]
RewriteRule ^(.*)$$1 [QSA,L,R=301]

Look : now it's work great even from google is redirected like it supose.
Posts: 35
Joined: Wed Jan 30, 2008 12:11 pm


Return to Apache mod Rewrite


  • Related topics
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest