![]() |
| ||||||||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
HyperActive Warrior
Join Date: Feb 2005
Location: , , USA.
Posts: 169
Thanks: 1
Thanked 0 Times in 0 Posts
|
Hi Warriors,
Let's say that I have a website and you can access the content as below...This will create duplication issues in Google if I understood it correctly. www.abc.com www.abc.com/index.html www.abc.com/index.asp www.abc.com/ abc.com www.abc.com/home.html From my understanding, to solve the issue I would have to create a 301 redirect to tell Google my preferred URL version. So would this be the correct code to take care of all the canonical issues above so Google will recognize that www.abc.com is the referred version by putting this in the .htaccess file? Or is there anything else that is needed? Also would this be applicable to all sites (asp,php,html, jsp etc)? RewriteEngine On RewriteCond %{HTTP_HOST} ^abc\.com RewriteRule (.*) http://www.abc.com/$1 [R=301,L] Appreciate Your Help.. Many Thanks, Chloe |
|
Make $20-$75/Hour to fill out online surveys, get paid to read e-mails,
shop, eat at your favorite restaurant, and fly around the world for next to nothing. www.secretshopperclub.com Become my partner - Make 50% in commission of all sales referred http://www.secretshopperclub.com/amember/affsignup.php |
|
|
|
|
|
|
#2 |
|
HyperActive Warrior
Join Date: Mar 2009
Location: Watford, England
Posts: 163
Thanks: 2
Thanked 4 Times in 4 Posts
|
I think this problem is less important than it once was. Google know's that so many sites have www.mydomain.com and www.mydomain.com/index that it's aware they are not all scammers.
I can't help you with code though I'm afraid but I wouldn't say if in doubt just do each iteration seperatly. |
|
Last edited by distinctly_digital; 10-28-2009 at 04:59 AM. Reason: typo |
|
|
|
|
|
|
#3 |
|
Active Warrior
War Room Member
Join Date: Oct 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
Hi,
Adding redirect rules to the .htaccess file is best. The following code will redirect users (as well as Google) to the www version of the website as well as redirect index webpages to the standard root / RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.abc\.com$ [NC] RewriteRule ^(.*)$ http://www.abc.com/$1 [L,R=301] redirect 301 /index.html http://www.abc.com/ redirect 301 /index.asp http://www.abc.com/ redirect 301 /home.html http://www.abc.com/ Hope this helps. |
|
Article AutoTasker - Article Creation Using Anonymous Humans!
|
|
|
|
|
| The Following User Says Thank You to netfq For This Useful Post: |
|
|
#4 |
|
HyperActive Warrior
Join Date: Feb 2005
Location: , , USA.
Posts: 169
Thanks: 1
Thanked 0 Times in 0 Posts
|
Thanks a lot Netfq,
So basically the below script will work on all websites (php,asp,html, jsp etc)? So if I want to make sure that people who type in abc.com without the www and I want this 301 redirect to www.abc.com, should I just add that to the below and if so how? RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.abc\.com$ [NC] RewriteRule ^(.*)$ http://www.abc.com/$1 [L,R=301] redirect 301 /index.html http://www.abc.com/ redirect 301 /index.asp http://www.abc.com/ redirect 301 /home.html http://www.abc.com/ Thanks a million Chloe |
|
Make $20-$75/Hour to fill out online surveys, get paid to read e-mails,
shop, eat at your favorite restaurant, and fly around the world for next to nothing. www.secretshopperclub.com Become my partner - Make 50% in commission of all sales referred http://www.secretshopperclub.com/amember/affsignup.php |
|
|
|
|
|
|
#5 | ||
|
Active Warrior
War Room Member
Join Date: Oct 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
Quote:
Quote:
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.abc\.com$ [NC] RewriteRule ^(.*)$ http://www.abc.com/$1 [L,R=301] | ||
|
Article AutoTasker - Article Creation Using Anonymous Humans!
|
|||
|
|
|
|
|
#6 |
|
HyperActive Warrior
Join Date: Feb 2005
Location: , , USA.
Posts: 169
Thanks: 1
Thanked 0 Times in 0 Posts
|
Thanks a lot
So what about the other versions below as well as the version without the www? http://www.abc.com/index.php http://www.abc.com/home.php http://abc.com/ abc.com etc So how would I put all these together in the htaccess file? So sorry for my lack of knowledge here.. Thanks a bunch, Chloe |
|
Make $20-$75/Hour to fill out online surveys, get paid to read e-mails,
shop, eat at your favorite restaurant, and fly around the world for next to nothing. www.secretshopperclub.com Become my partner - Make 50% in commission of all sales referred http://www.secretshopperclub.com/amember/affsignup.php |
|
|
|
|
|
|
#7 | |
|
Active Warrior
War Room Member
Join Date: Oct 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
Quote:
| |
|
Article AutoTasker - Article Creation Using Anonymous Humans!
|
||
|
|
|
|
|
#8 |
|
HyperActive Warrior
Join Date: Feb 2005
Location: , , USA.
Posts: 169
Thanks: 1
Thanked 0 Times in 0 Posts
|
Thanks Netfq,
This (creating htaccess files) seems to work for websites in php and html (sites that use a linux server). What about websites that use ASP how would that be implemented? So in this case lets say I have the below versions: www.abc.com/index.asp abc.com.asp www.abc.home.asp and I want them all to 301 to www.abc.com Sorry for bothering you again for this... Millions of thanks Chloe |
|
Make $20-$75/Hour to fill out online surveys, get paid to read e-mails,
shop, eat at your favorite restaurant, and fly around the world for next to nothing. www.secretshopperclub.com Become my partner - Make 50% in commission of all sales referred http://www.secretshopperclub.com/amember/affsignup.php |
|
|
|
|
|
|
#9 | |
|
Active Warrior
War Room Member
Join Date: Oct 2009
Posts: 29
Thanks: 0
Thanked 5 Times in 5 Posts
|
Quote:
Have a look at: Helicon Tech - IIS modules and ISAPI filters for URL rewriting and search engine optimization | |
|
Article AutoTasker - Article Creation Using Anonymous Humans!
|
||
|
|
|
![]() |
|
| Tags |
| 301, question, redirect |
| Thread Tools | |
|
|
![]() |