phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Simple redirect question

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
Pottsy



Joined: 03 Aug 2006
Posts: 8

Simple redirect questionPosted: Thu Aug 31, 2006 3:45 pm    Post subject: Simple redirect question

I have the advanced rewrite and the sitemaps mod on my site, www.civinfo.com

BUT, my site is actually a subdomain, it's www.civinfo.colonyrpg.com. I'd like to redirect any request on www.civinfo.colonyrpg.com to www.civinfo.com - how do I do it?

Sorry for being a bit of a newbie with this Embarassed

My htaccess looks like:
Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^civinfo\.com$ [NC]
RewriteRule ^(.*) http://www.civinfo.com/$1 [QSA,L,R=301]
RewriteBase /

#########################################################
# forum SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.forum-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^forum/.+/([^/]+\.html)$ /forum/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forum/.+-vc([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/.+-vf([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/.+-vf([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forum/.+-vt([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forum/.+-vt([0-9]+)\.html$ /forum/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^forum/member([0-9]+)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END forum PAGES
#####################################################

#########################################################
# MX GG_SITEMAPS REWRITE RULES            #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################



########################################################
# phpBB
RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L]
# mxBB
RewriteRule ^mx-sitemap.xml$ /sitemap.php?mx [L]
# KB
RewriteRule ^kb-sitemap-([0-9]+).xml$ /sitemap.php?kbid=$1 [L]
RewriteRule ^sitemap-kbcat.xml$ /sitemap.php?kbcat [L]

#########################################################
# END GG_SITEMAPS REWRITE RULES            #
#########################################################

########################################################
RewriteRule ^forum/sitemaps([0-9]+)\.html$ /forum/sitemaps.php?c=$1 [QSA,L]
RewriteRule ^forum/sitemaps\.html$ /forum/sitemaps.php [QSA,L]
RewriteRule ^forum/forum-m\ap\.html$ /forum/sitemaps.php?fim [QSA,L]
RewriteRule ^forum/forum-m\ap([0-9]+)-([0-9]+)\.html$ /forum/sitemaps.php?fmp=$1&start=$2 [QSA,L]
RewriteRule ^forum/forum-m\ap([0-9]+)\.html$ /forum/sitemaps.php?fmp=$1 [QSA,L]
#########################################################
# END SITEMAPS REWRITE RULES            #
#########################################################

Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14279

Simple redirect questionPosted: Thu Aug 31, 2006 10:58 pm    Post subject: Re: Simple redirect question

So everything is working great with your .htaccess except the www prefix redirection : http://civinfo.com/ works well, but the rewriterule seems to be tricked in your case by the sub-domain starting with the same "civinfo".

So please try :

Code:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.civinfo\.com$ [NC]
RewriteRule ^(.*) http://www.civinfo.com/$1 [QSA,L,R=301]


Instead of :


Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^civinfo\.com$ [NC]
RewriteRule ^(.*) http://www.civinfo.com/$1 [QSA,L,R=301]
RewriteBase /


This way should work for all cases. At least if your sub-domain is leading to the same exact folder as the main domain does.
You could have two phpBB scripts running on the same db after all Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Pottsy



Joined: 03 Aug 2006
Posts: 8

Simple redirect questionPosted: Fri Sep 01, 2006 3:28 pm    Post subject: Re: Simple redirect question

dcz,

I'm sorry, I didn't explain well enough!

I just need to 301 redirect any request to www.civinfo.colonyrpg.com to www.civinfo.com.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14279

Simple redirect questionPosted: Sat Sep 02, 2006 9:38 am    Post subject: Re: Simple redirect question

Well, unless, as I told you, you are running two separate instances of phpBB sharing the same DB on those two domains, which I doubt, what I suggested is even doing better than just redirecting on to the other.

Actually :
Code:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.civinfo\.com$ [NC]
RewriteRule ^(.*) http://www.civinfo.com/$1 [QSA,L,R=301]


Makes sure that only www.civinfo.com will be used as a domain, all other domains leading here will be http 301 redirected, thus the one you want.

If it's not working, it's either that, as said in the www prefix topic, you need to play around the rule to make it work for you particular server settings, or that you really have to instance of phpBB running. If so you'd just need to either set your dns to have you old sub domain leading to your new one, or to simply add this www prefix redirection in both ftp account.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Pottsy



Joined: 03 Aug 2006
Posts: 8

Simple redirect questionPosted: Sat Sep 02, 2006 12:31 pm    Post subject: Re: Simple redirect question

dc,

Once again you have come to my rescue. All working, thank you!
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14279

Simple redirect questionPosted: Sat Sep 02, 2006 11:26 pm    Post subject: Re: Simple redirect question

Wink

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: