Xepher.Net Forums

Content => Web Design => Topic started by: griever on June 08, 2007, 08:26:19 AM

Title: subdomain vs. domain
Post by: griever on June 08, 2007, 08:26:19 AM
Maybe someone who knows how search engines work can help me out here.  I switched my domain names in February/March.  Not surprisingly, traffic has dropped (but it's slowly rebounding!).  However, search engines still favor the xepher.net subdomain over my real domain, sometimes by a page or so of returned search results.  Any idea how I can fix this?  Or is it just a matter of time?
Title: Re: subdomain vs. domain
Post by: Xepher on June 08, 2007, 11:34:31 AM
Well, when doing what searches do they favor it? Searching for "chanpuru" comes up with the domain first. Searching "Griever's Anime" comes up with the subdomain that includes the word "griever" in it. Perhaps you should consider an apache redirect? If people visit via the subdomain, it'll send a "file has moved" redirect to the full domain name. Google takes those into account I believe. Also, it's likely a lot of people are still linking to the subdomain URL, more than the chanpuru one, so google things it's a better result (As google has no idea they're the same site.)
Title: Re: subdomain vs. domain
Post by: griever on June 08, 2007, 12:00:16 PM
Oops, sorry, when they do a straightforward search for "anime episode summaries".  Most of my affiliates and link exchanges have updated their links to the chanpuru address and I've submitted a sitemap with every page with the chanpuru address starting every link.

Thanks for the apache redirect idea...I'll start looking up how to do it. :)  I have a PHP redirect for the old grieversanime.org domain, but I guess that didn't work.
Title: Re: subdomain vs. domain
Post by: Xepher on June 08, 2007, 12:25:46 PM

RewriteCond %{HTTP_HOST} !^chanpuru\.org$ [NC]
RewriteRule ^/(.*) http://chanpuru.org/$1 [L,R=301]


Put that in a file named ".htaccess" (note the leading dot) in your public_html folder. What it'll do is read the HOST used by the browser to connect to the site, if it's not EXACTLY "chanpuru.org" it'll redirect the request to chanpuru.org, with a status code of 301 (which means "moved permanently.") This is just modifed from some old stuff I had laying around, so it's not tested recently. Try it, let me know if it works or if you have problems.

EDIT: Note that when I say, "exactly" it means www.chanpuru.org will get redirected as well. That shouldn't be a problem, so long as that's how you want it. If you want softer filtering, remove the caret (^) from in front of chanpuru.org on the first line, as it marks "line starts here." Then it won't alter anything where the host ENDS with "chanpuru.org" If you want the www. prefix to be the default, it might be wise to change the second line to www.chanpuru.org too. (Me, I hate typing needless w's.)
Title: Re: subdomain vs. domain
Post by: griever on June 08, 2007, 12:52:59 PM
EDIT: Fixed it! (For once, I do things right!)
RewriteCond %{HTTP_HOST} !^chanpuru\.org$ [NC]
RewriteRule ^(.*) http://chanpuru.org/$1 [L,R=301]

Removed the slash in the RewriteRule ^ bit.  Thank you!

And I just got your title.  And had to play the mp3.