|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I need a little help here. My directory is being indexed two ways...not good. Yahoo lists my site as http://top-affiliate.com and google indexes it as http://www.top-affiliate.com
I want all the search engines to index my site as http://www.top-affiliate.com How do I do this and make sure all the search engines update their listings? What the best way. A .htaccess redirect or a meta? If you could post the exact code for the best way that would be very helpful. |
|
|||
|
Since you asked about .htaccess, I am assuming you're using Apache. The best way I know to handle this is by editing your httpd.conf file with the following:
Code:
<VirtualHost 12.109.80.231:80> ServerAlias toolpartsdirect.com Redirect permanent / http://www.toolpartsdirect.com/ </VirtualHost> If you don't have that much access on your server, then I'm not sure how to best handle it. .htaccess would affect both www and non-www (unless you have them hosted in different directories, which may be an option), so you'd be redirecting in an infinite loop from my understanding. Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
Would something like this work on my index.php page?
Code:
<?php
//////////////////////////////////
// retrieving the server host name
if (preg_match("/^.(.*?)$/i", $_SERVER["HTTP_HOST"], $serverName)) {
// issue a seo friendly 301 redirect
header("HTTP/1.1 301 Moved Permanently");
// redirect target
header("Location: http://www.top-affiliate.com". $serverName[1] . $_SERVER["REQUEST_URI"]);
exit();
}
//////////////////////////////////
?>
|
|
|||
|
To put it simply, httpd.conf is the apache configuration file. Ours is in /etc/httpd/conf/ and it requires administrator (root level) access, although this change could also be done by editing some included files (httpd.inc) that are in the conf directory of each domain's webspace. Since each type of control panel handles things differently, it is tough to say for sure where your particular files will be found.
Also, after these changes are done, you need to restart Apache. Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
||||
|
Do you have Cpanel 10? That's what I use for all of my sites and I would just go to the control panel www.yoursitename.com/cpanel and click on redirects and make a permanent redirect for http:// --> http://www.
my $0.02 NeO1 |
|
||||
|
Just simply use a Rewrite.
Create an .htaccess file (with notepad, in case you don't already have one). Use the following: RewriteEngine On RewriteCond %{HTTP_HOST} ^yoursitename.com$ RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [R=301,L] Upload to your parent directory, wherever your page files are stored. That should do it. Don't forget to replace "yoursitename" with your domain name.
__________________
Domain Name Registration and Website Hosting :: DesignerTrade |
|
|||
|
Using that code returns my pages as http://www.top-affiliate.com/index.php?req=cat&id= and takes away all of my PR.
__________________
Stephen Ralph Affiliate Marketing - www.Top-Affiliate.com Post Free Classified Ads - www.FreeAdvertisingBlog.com |
|
|||
|
Stephen, just use the reverse version:
Quote:
__________________
NEW! ChillyCool Web Digger SEO-friendly directory, no recip required Get Rich Online in 387,923 Painful, Difficult Steps |
|
||||
|
StephenR do you have any way of knowing who is linking to your site as the non-www version? I had the same issue and found a couple ibl sources who linked to me without the www . After contacting them they were willing to change the url in the link to add 'www'. For me I used the code above and it worked perfectly, and kept my PR. I don't have any dynamic pages though currently on the site I used it for, so maybe that's why. Also double check to ensure all internal links use www , or whichever version you end up going with.
Interesting, my experience was the opposite... google listed the http version and the others listed the www verion.
__________________
Domain Name Registration and Website Hosting :: DesignerTrade |
|
|||
|
I fixed it with a .htacess redirect. Good point with the IBL's...I have a lot of them though so it will take some time to identify the ones that need updating. Thanks for all the help gentleman.
__________________
Stephen Ralph Affiliate Marketing - www.Top-Affiliate.com Post Free Classified Ads - www.FreeAdvertisingBlog.com |
|
||||
|
StephenR. that's great news you have a solution that works. I've tried 301 redirects but was getting loops when clicked on from an SE (with a timeout error), or else the pr didn't transfer. I'm curious how it was written, if you ever get a chance.
Best regards!
__________________
Domain Name Registration and Website Hosting :: DesignerTrade |
|
|||
|
Code:
RewriteCond %{HTTP_HOST} ^top-affiliate.*
RewriteRule ^(.*) http://www.top-affiliate.com/$1 [R,L]
__________________
Stephen Ralph Affiliate Marketing - www.Top-Affiliate.com Post Free Classified Ads - www.FreeAdvertisingBlog.com |
|
||||
|
Ok cool. I see what you did.
Congratulations! Nice getting something resolved finally, isn't it. :)
__________________
Domain Name Registration and Website Hosting :: DesignerTrade |
|
|||
|
Quote:
Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
|
|||
|
jawn_tech: Heck yeah it's nice, that was driving me nuts :)
brian.mark: Glad I could help.
__________________
Stephen Ralph Affiliate Marketing - www.Top-Affiliate.com Post Free Classified Ads - www.FreeAdvertisingBlog.com |
|
|||
|
Just tried that on another site, and it works wonderful. Thanks a ton.
Brian. [edit] I had to change to [R=301,L] for a 301, otherwise it was doing a 302 which isn't good.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |