always rewrite www.mysite.com/forum as forum.mysite.com?

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

always rewrite www.mysite.com/forum as forum.mysite.com?

Postby finallygreen » Mon Aug 25, 2008 5:58 am

Hello,

I found this great site full of great SEO info tonight, and decided I wanted to try and implement one of the mod rewrites on my forum. First, however, the instructions suggested that I be sure to make sure I had some code in my .htaccess that would always redirect mysite.com to -www.mysite.com. Well, the code went perfectly...but it also got me thinking. I have a subdomain set up with my host (through the cpanel) so that everything at -www.mysite.com/forum can also be reached from forum.mysite.com. Well, after realizing that those duplicates from mysite.com could hurt my page rankings by doubling the content of -www.mysite.com, I also realized that I need to find a way to make -www.mysite.com/forum always rewrite to forum.mysite.com.

How do I do this?
finallygreen
 
Posts: 16
Joined: Mon Aug 25, 2008 5:49 am

Advertisement

Postby dcz » Wed Aug 27, 2008 1:52 pm

A sub domain is to be considered the same as a main domain as far as phpBB settings and .htaccess.

So to redirect -www.mysite.com/forum to forum.mysite.com, you'd need to implement the www prefix redirection (method n°2) for the sub domain, something like :

Code: Select all
RewriteCond %{HTTP_HOST} !^forum\.example\.com [NC]
RewriteRule ^(forum/)?(.*)$ http://forum.example.com/$2 [QSA,L,R=301]


I just added the forum path that could be passed from the main domain to filter it properly.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21429
Joined: Fri Apr 28, 2006 9:03 pm

Postby finallygreen » Wed Aug 27, 2008 2:07 pm

First, thanks for the response :)

Second, that didn't quite work.....I tried that and is redirects EVERYTHING to forum.mysite.com......even if i type -www.mysite.com
finallygreen
 
Posts: 16
Joined: Mon Aug 25, 2008 5:49 am

Postby finallygreen » Fri Oct 24, 2008 2:15 am

any chance for some help on this one? I did wait 2 months before asking again :)
finallygreen
 
Posts: 16
Joined: Mon Aug 25, 2008 5:49 am

Postby dcz » Sun Oct 26, 2008 12:49 pm

Sorry for the delay ;)

Have you implemented this in the sub domain's root .htaccess, eg in -www.example.com/forum/ ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21429
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests