Keep subdomain.com as url - even though there is a redirect

Using a single web hosting account to host multiple sites

Keep subdomain.com as url - even though there is a redirect

Postby rainthebat » Thu Oct 09, 2008 8:03 am

Hi,

I am very amateur with mod_rewrite.

I currently have setup:

a simple redirect of subdomain.com to primary-domain.com
because it is a redirect the url always appears as primary-domain.com

What would the rewrite rule look like for subdomain.com to always be diplayed as the url?

I also must ask if this would hurt search engine rankings? primary-domain.com has been around for longer and has higher rankings, but subdomain.com is a more aesthetic url;)

my subdomain is: fabstash.com
my primary domain is: fabricstashinc.com
rainthebat
 
Posts: 3
Joined: Thu Oct 09, 2008 7:38 am

Postby richardk » Thu Oct 09, 2008 11:27 am

What happens when you go to subdomian.com without the current redirect? Does it have it's own document root? What is your primary domain's document root?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby rainthebat » Thu Oct 09, 2008 2:24 pm

richardk wrote:What happens when you go to subdomain.com ...


hmmm... without the redirect it works correctly. I deleted the rewrite rule without any problem.

The subdomain shares the same doc root as the primary.

the primary domain has a doc root of /public_html/ - I assume that is the doc root, unless you mean further up a couple levels.



Also as a side note, I changed most of my pages over to the subdomain address as default (after I posted my first posting here), although this seems like quite risky business with a potential of losing a lot with search engines. See, the search engines see the word 'fabric' in my primary-domain (fabricstashinc.com) and that is important, but I like the simplicity of telling people to go to fabstash.com which is my subdomain with a bit lower rankings.
rainthebat
 
Posts: 3
Joined: Thu Oct 09, 2008 7:38 am

Postby richardk » Thu Oct 09, 2008 2:32 pm

You might want to redirect the old domain to the new domain so that you get a single domain used all the time.
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^fabstash.com$ [NC]
RewriteRule ^(.*)$ http://fabstash.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby rainthebat » Fri Oct 10, 2008 5:47 am

Yes, this is what I was looking for! I can now keep the aesthetic url without loosing pace with the search engine rankings.

Thank you for helping out richardk -
rainthebat
 
Posts: 3
Joined: Thu Oct 09, 2008 7:38 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 16 guests

cron