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
-
Writing Service/Product Descriptions
Hi, I work for a site that allows people to book a variety of different services in different locations (mainly hair and beauty related). The site is still in development so I can't link to it I'm afraid. My colleague is about to start writing these descriptions for each of the beauty salons we have signed up and I thought I'd take the opportunity to check what everyone else thought about these descriptions. As far as I'm concerned, a near perfect example can be found at http://www.toptable.co.uk/fishers-in-the-city We have about 100 words at the most, so I was thinking that as long as we get in the name of the salon, the location (being more descriptive than the general area our services search function allows for) and the USP of each salon - their specialty services. Is there anything else you'd include? Foremost, I want this to be as descriptive as possible to offer more detailed information about the salon. Thanks!
On-Page Optimization | | LeahHutcheon0 -
Index Page Content
Mozers, I am of the believe and as a person who puts the utmost emphasis on the index page of any website I am trying to rank, especially with a new domain ... insuring content is relevant, structured, optimized and we have some link juice flowing in. I find once we get the index page ranked, Google's little bots then start to index and rank accordingly the rest of the website ... and we start producing results. We also develop websites (dare I say its where we expertise in) and unexpectantly the client has asked us to carry out SEO work additionally to their web development. Problem lies here, their index page, has absolutely no written content at all, just one large image with a logo (Fashion Website) ...Which I identify as a huge issue as per my explanation is paragraphs one or two. I am sure withe the many more qualified SEO experts and gurus within the SEOmoz community, you have also come across this issue So a few questions, if you don't mind adding advice. 1 - Am I putting too much emphasize on content within the index page, in terms of indexing and actually ranking ...yes I appreciate that terms within the website will be ranked against other pages other than the index page, but will it harm us for having no content at all within the index page 2 - If so, and yes is the answer to above, how do we handle it, we have spoke with the client and he is pretty adamant that he want the index page as is, he has been through out the whole website building process. As suggested, any advice would be really appreciated, its a difficult market to rank within a it is, and i can only see this index page making the task a lot more difficult Cheers John
On-Page Optimization | | Johnny4B0 -
Subdomain vs. Root Domain design
I know that there are penalties if you have a navigation item in your categories that links to another site (root domain) that yields the same design as the original link. Is there any negative SEO implications with having a subdomain with the same design as the root domain i.e. root.com vs. store.root.com And the navigation functionality within will have links to both store.root.com as well as root.com directories? Thanks in advance.
On-Page Optimization | | customerparadigm.com0 -
Does Bing consider http://www.domain.com the same as https://www.domain.com?
Bing Webmaster Tools showed me that sometimes it displays https://www.domain.com in its results and sometimes http://www.domain.com. That got me thinking. Does Bing consider https to be a seperate duplicate copy of the http version? IE does my site get knocked down for duplicate content because of this? In Google webmaster tools, I can tell it whether I want https or http. But I dont know how to tell Bing. Any pointers will be appreciated. Thanks Dan
On-Page Optimization | | DanFromUK0 -
Quickest Way to get indexed?
We would like to index a new site on all major search engines. What is the quickest way to do so?
On-Page Optimization | | ClaytonKendall0 -
No index parts of a page?
Little bit of an odd question this, but how would one go about getting Google to not index certain content on a page? I'm developing an online store for a client and for a few of the products they will be stocking they will be using the manufacturers specs and descriptions. These descriptions and specs, therefore, will not be unique as they will be also used by a number of other websites. The title tag, onpage h1 etc will be fine for the seo of the actual pages (with backlinks, of course) so the impact of google not counting the description should be slight. I'm sure this can be done but for the life of me I cannot remember how. Thanks Carl
On-Page Optimization | | Grumpy_Carl0 -
SEOMOZ crawler ignoring redirect?
My crawl report for www.poker-coaching.net show a number of duplicate content warnings.
On-Page Optimization | | CatfishTPA
First, it shows a warning for www.poker-coaching.net and www.poker-coaching.net/, although there is a redirect in place for this, and for non-www. to www. as well. So IMO there is no duplicate content here, so why the error message?
Next, it shows a duplicate content warning for a number of pages, but when I click the number on the right, there is no info an which pages contain the duplicate content. Will this info be there later when the crawl is completed? My problem is that this is my oldest site, but since over one year it seems to have a penalty which I can't get rid of - I cannot identify the reason for the penalty. I already rebuilt the site from scratch once, but I still do not see results. If a membership at SEOMOZ would be able to help me bring this site back on track, that would already be worth one years membership fees, so I'd really be very thankful if someone could take a look at the site and give me an idea about what needs to be done here.0 -
Google indexing Internal Search Results
Greeting, Currently I have noticed that Google is starting to index our internal search page results. Should I block those pages in our robot txt file or have you ever heard of any websites that actually gained traffic or rank by letting Google index those pages? Thanks
On-Page Optimization | | Tonyd230