301 redirect (www.domain.com/index to www.domain.com)
-
Hello,
Please let me know what are the exact right steps in order to get rid of the duplicate content issues related with:
www.domain.com/index.html same as www.domain.com without creating an infinite loop.
Do you have a step by step guide posted within seomoz including 301 redirect for non www to www for all urls and index.whatever to main domain name without going into a infinite loop ?
btw how to you spot the loop ? is it obvious like never ending refresh of the home page ?
thanks a lot !
-
Well, I would recommend you alter the internal links to just point to the new '/' default, but in the meantime...
I would have thought your code would have worked, but every time I try it my site falls over. It might work for you though. Give it a try but test it straight away
I'll see if I can get a different version working on my test site for you if not
-
seomoz tool is showing duplicate pages for those 3. Each of the version has at least 1 internal and even external links.
all 3 respond in the browser with the same layout/page
-
Hmm, maybe, I doubt the index.php is doing anything as if there's a index.html and index.php the .html takes precedence.
Check what's in the .php file, might be easier just to delete it.
-
Can I use a code like this ? (i've added one entry for index.php as it looks like the site has both an index.html and an index.php)
Barry Smith
Journeyman264 mozpoints
6 helpful answers
1 SEOmoz endorsed answers| Helpful Answer | Barry Smith, Head of SEO at Gaming Media Marketing | about 2 hours ago |
Probably the simplest way to redirect the non-www to the www is to put this in your .htaccess file
RewriteEngine On Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]RewriteCond %{THE_REQUEST} ^./index.html
RewriteRule ^(.)index.html$ http://www.example.com/$1 [R=301,L]RewriteCond %{THE_REQUEST} ^./index.php
RewriteRule ^(.)index.php$ http://www.example.com/$1 [R=301,L] -
Thanks mate !
More then helpful.
-
Yeah, if it doesn't work you'll probably be faced with a blank page or you may get a 500 server error or maybe a 310. It should be obvious pretty fast
-
how it will behave if the redirect is not correct ? It will be visible ? (like a never-ending refresh of the main page)
-
I agree with Barry, but watch out for that last snippet. I've got caught when hosting companies redirect on their side. So test before walking away for more coffee : )
-
The last part redirects index.html to /
There would only be a loop if you redirected / to index.html
99.9% sure this'll work for you I'm using the exact code on a small site right now and it's working fine
-
is the last part safe ? as far as the infinite loop things that some are afraid of..
-
Probably the simplest way to redirect the non-www to the www is to put this in your .htaccess file
RewriteEngine On Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]RewriteCond %{THE_REQUEST} ^./index.html
RewriteRule ^(.)index.html$ http://www.example.com/$1 [R=301,L]For reference the .htaccess file goes in the root of your domain via whatever file transfer program you use and of course replace example.com with your domain
If you get stuck, let me know
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How to increase domain authority?
Hi, I created a new blog about 2 months ago and the domain authority is still at 1 but the page authority is booming like a rocket. How do I increase DA? Please visit my blog and suggest the possible ways. Regards,
On-Page Optimization | | suzy470 -
Does Widgetised Content Index The Same As A Regular Page
Hi, We have a website that was built in my opinion bizarrely where the bottom half of the page where most of the content is, is a widget. I just wondered if the content being in a widget is indexed any differently. I ask as normal pages seem to index and rank much better than the wordpress template using the widget. Hope someone might be able to clarify this. Thanks
On-Page Optimization | | denismilton0 -
301 Redirect from .html
Hi there, Following on from this post:
On-Page Optimization | | finelinewebsolutions
http://moz.com/community/q/help-with-duplicated-content Please could one confirm that using the following code in our htaccess file will stop the duplicated content issue we are having. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+.)+html?\ HTTP
RewriteRule (.+).html?$ http://www.bereavementstationery.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html Kind Regards Alec0 -
Tools for seaching for keyword rich domains
Could I get some recommendations please for tools that will help me find keyword rich domains in my space. Also I did try out the Go Daddy bulk domain checker (just copy and paste domains into box) but it doesn't let me bulk search .co.uk domains. Any ways around that one?
On-Page Optimization | | Clicksjim0 -
Cookie Free domains
What is the advantage of having a cookie free domain and how does one set this up on wordpress?
On-Page Optimization | | casper4340 -
Multiple silos/products/landing pages. How to design the root page for conversion?
Hi everyone, First post. Tried a few awkward searches on the topic but I must be using bad keywords. I'm re-designing a site that has multiple products and matching multiple audiences. This means we have multiple sillos for multiple groups of keywords with the supporting pages for each silo landing page. Currently I'm working on updating the look and text of those landing pages for each silo to increase conversion. This leaves me with the root web page. We get quite a lot of search traffic from people searching our brand name - so this results in clicks straight through to our root domain. There are no product specific landing pages because it could be any one of the 3-5 different personas we have hitting the site from that source. Does anyone have any good examples of where a site has had multiple products and needed to segregate their audience on a root top page? I'd like to see some examples and hear peoples thoughts. At the moment I'm thinking I need to fill that page up with trust factors as to why people should use us as a company, along with navigational elements in relation to each and every product so they can click through to the proper landing page. The main way I can see on executing that is to have a rotating banner with the same tag line "this is what we do" but be alternating between banners relating to each product.. with their own click through button to go to the respective landing page. Thoughts anyone? Example of sites doing this well?
On-Page Optimization | | specific0 -
Blog On Domain Or Off?
Hi, Which do you think is more powerful ito SEO rankings for my domain? Should I make the blog part of my domain or should I create a blog on a seperate domain? Zane
On-Page Optimization | | Springboks0 -
Why isn't Google indexing me?
Recently got handed off a .org site for a quasi state agency here in Michigan. Turns out the developer had the site live for the past six months but left the noindex, nofollow tag on everything so the site was invisible to search engines. Obviously we wiped all of those things a couple weeks ago when we got started, added all of our sitemaps to bing/yahoo/google webmaster tools and we've already started getting indexed by yahoo and bing and showing up for branded terms...but NOTHING from Google. WMT says our pages are all indexed, but we aren't showing up for anything in search and we don't seem to be indexed at all. Granted, if this site was brand new and didn't have any links I could see us taking a little time to get found, but this site has very good .gov and .edu links, plus we've built some other solid links to it since we've launched and Google continues to ignore it. I haven't seen this before, but could Google still be ignoring us from the months of noindex, nofollowing? If so, any tips on how to get back in teh Google's good graces here?
On-Page Optimization | | NetvantageMarketing0