| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
Pottsy
Joined: 03 Aug 2006 Posts: 8
|
Posted: 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
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

Joined: 28 Apr 2006 Posts: 14279
|
Posted: 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
++ |
_________________ 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 |
|
 |
Pottsy
Joined: 03 Aug 2006 Posts: 8
|
Posted: 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

Joined: 28 Apr 2006 Posts: 14279
|
Posted: 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 |
|
 |
Pottsy
Joined: 03 Aug 2006 Posts: 8
|
Posted: 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

Joined: 28 Apr 2006 Posts: 14279
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |