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/(.*)$ http://forum.example.com/$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.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Advertisement

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 ^(.*)$ http://www.forum.pariuri-x.ro/$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 ^(.*)$ http://www.forum.pariuri-x.ro/$1 [QSA,L,R=301]

Look : http://www.forum.pariuri-x.ro/ now it's work great even from google is redirected like it supose.
mariusbabtan
 
Posts: 35
Joined: Wed Jan 30, 2008 12:11 pm

Previous

Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests