Do I need to 301 redirect www.domain.com/index.html to www.domain.com/ ?
-
So, interestingly enough, the Moz crawler picked up my index.html file (homepage) and reported duplicate content, of course. But, Google hasn't seemed to index the www.domain.com/index.html version of my homepage, just the www.domain.com version. However, it looks like I do have links going specifically to www.domain.com/index.html and I want to make sure those are getting counted towards my overall domain strength.
Is it necessary to 301 redirect in the scenario described above?
-
Hi,
I tested the code mentioned above:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)index.(html|php)$ http://%{HTTP_HOST}/$1 [R=301,L]It works well for index.php, but not for XX-index.php. The site where I tested this code is bilingual, so there is also a GR-index.php file and the above code redirects it to the root domain as well.
Also, another problem is that the code above causes the redirection of index.php inside any directory. For example, http://domain.com/directory/index.php is redirected to http://domain.com/directory/
How can I avoid this and keep only a "basic" redirection of http://domain.com/index.php to http://domain.com?
Yannis
-
I would recommend you to do that. Homepage may have different versions depending on the CMS you are using.
index.htm index.html
index.php
So as @donford mentioned you can fix that with .htaccess
-
Yep,
This code inside your .htaccess file should fix that.
``RewriteEngine On RewriteBase /` RewriteRule ^(.*)index\.(html|php)$ http://%{HTTP_HOST}/$1 [R=301,L]` Hope it helps, Don
-
Yes, you will want to redirect it. Be careful though as a lot of times this isn't done correctly and creates a loop. There are multiple ways to do this including but not limited to DirectoryIndex or a RewriteRule
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
-
Wordpress SEO/Tag plugin recommendation for sports (soccer) website
I own a Wordpress website which covers soccer in the DC MD VA area called DMV Soccer http://www.dmvsoccer.com/ We write weekly recaps where we tag a player who has scored a goal or performed well in a game. For each player, obviously, a tag is created. What I'm looking for is a plugin or solution that would allow me to tag a player, but also automatically assign a team to that player so that the team name and player's name are optimized on the individual player's tag page. So if I were to tag George Murphy on a recap, and I assign him to a team, let's say DC United. The tag page would have a title, something like: George Murphy Soccer Player for DC United and the meta description: George Murphy, soccer player from MD who players for DC United archives Or something similar, if that makes sense. Should I skip using tags and instead start assigning each player as a sub-category under each team? I'd like to try to avoid that, because not each category will be based on a player. Any suggestions in terms of existing plugins or other recommendations?
Web Design | | georgetsn1 -
301 htaccess redirect or 301 HTTP DNS Redirect
Hi, I was wondering which you would recommend for a 301 redirect. Should we do a 301 redirect from .htacess or should we do a HTTP DNS 301 redirect. The HTTP redirect, does a redirect from the DNS Provider and doesn't require that we keep hosting the site while the htacess redirect still requires hosting. Thanks!
Web Design | | MattJD0 -
Multiple Sites, multiple locations similar / duplicate content
I am working with a business that wants to rank in local searches around the country for the same service. So they have websites such as OURSITE-chicago.com and OURSITE-seattle.com -- All of these sites are selling the same services, but with small variations in each state due to different legal standards in the state. The current strategy is to put up similar "local" websites with all the same content. So the bottom line is that we have a few different sites with the same content. The business wants to go national and is planning a different website for each location. In my opinion the duplicate content is a real problem. Unfortunately the nature of the service makes it so that there aren't many ways to say the same thing on each site 50 times without duplicate content. Rewriting content for each state seems like a daunting task when you have 70+ pages per site. So, from an SEO standpoint we have considered: Using the canonocalization tag on all but the central site... I think this would hurt all of the websites SERPs because none will have unique content. Having a central site with directories OURSITE.com/chicago -- but this creates a problem because we need to link back to the relevant content in the main site and ALSO have the unique "Chicago" content easily accessable to Chicago users while having Seattle users able to access their Seattle data. The best way we thought to do this was using a frame with a universal menu and a unique state based menu... Also not a good option because of frames will also hurt SEO. Rewrite all the same content 50 times. You can see why none of these are desirable options. But I know that plenty of websites have "state maps" on their main site. Is there a way to accomplish this in a way that doesn't make our copywriter want to kill us?
Web Design | | SysAdmin190 -
Is there a limit for 301 redirection in htaccess file?
For the SEO perspective, there is a limit for the number of 301 redirection inside the htaccess file?
Web Design | | Naghirniac0 -
Random 302 Redirect (Wordpress CMS)
So this new project that i am working on is a redesigned CMS site using Wordpress (php based). Before i started on the project they made a few major updates that include: Changed from ID based URLS to SEO friendly URLS Added multiple languages in directories www.domain.com/en www.domain.com/fr www.domain.com/de etc... Due to the new languages they wanted to have the previous home page, www.domain.com, redirect to the proper language based on their IP address. Currently they are using a 301 redirect through a php header. So if i was visiting the site from my hometown of Cleveland, Ohio and i type www.domain.com into the browser. I would automatically redirect to www.domain.com/en and i would have the option to switch languages if needed. The issue: When i first added their site into SEOMoz the crawl returned a large amount of 302 redirects coming from their old homepage www.domain.com. So i took a look at the header calls using IE's webmaster tools and Firebug in Firefox. In both profilers it showed the same problem. Before the 301 header redirect there was a 302 redirect called first When viewing the response header it mentioned an x-pingback of some file that didn't even exist on the site: www.domain.com/xmlrpc.php This is obviously a huge issue because any link value from the old homepage will be lost due to the 302 not passing the value. I have tried search the almighty Google for help but it has gotten me no where. I have a hunch it is something to do with Wordpress but that is based on nothing but my gut. Any help is greatly appreciated. I got to get that 302 gone or changed to a 301 🙂 Regards - Kyle
Web Design | | kchandler0 -
How do search engines interpret <hgroup>...</hgroup> tags?
Hi there. I'm building an HTML 5 site and through research of new HTML 5 elements I've seen little conclusive information about the interpretation of the new <hgroup>tag, in terms of SEO application and interpretation. In particular does Google interpret the nested heading tags as individual elements or does it combine them into one entity? For example, say I have: <hgroup> # Article Heading ## Article Sub-heading </hgroup> How is this interpreted by Google and what would be some good SEO best practices regarding the <hgroup>tag in HTML5: Is it interpretted as a single tag (" Article Heading: Article Sub-heading ") or two separate heading tags (one and one )? Also, how much does the ordering of the tags matter (say for example I wanted something like the following for visual purposes? <hgroup> ## Article Sub-heading # Article Heading </hgroup> One last thing: is it safe to assume that it is indeed OK to have multiple tags on a single page (as referenced by Matt Cutts a while back in a Webmaster Video)? Thanks! </hgroup> </hgroup>
Web Design | | LMDNYC2 -
Changing the domain - To do or not to do - that is the question
Hello, I am in the process of updating my website (hopefully to improve SEO). It is a major update as we are going from 20,000 product line to 200,000 product lines and hiring two marketing people to work on more content. Unfortunately, I think my domain isn't the best i.e. www.direct-tractorparts.com Some of the parts have long part numbers and I am worried that my URLs will be too long i.e. I will lose link juice from the search engines. typical url www.direct-tractorparts.com/6XY41210TTTAZCAz2 I am thinking of launching the new site with a shorter domain name rather than updating the old site. My site doesn't have that many backlinks but generates a decent level of business for my company. Not sure if it would be worth setting up another brand or not Anyone got any advice?
Web Design | | DavidLenehan0 -
Need advice on diplaying content for Search
Hi every body, I am doing landing page redesign(s). Does any body know or can refer a content carousel that can rotate video and pictures? The "site with images" search option result is a compelling reason to showcase pictures if your space competeiveness (showroom, merchandise, etc) can be improved with a strong image presence. here is my main landing page http://www.shearerpainting.com I know there is alot of stuff, and confusing call to action, but I am looking for strategies to clean it up, clear fous on action (get bid, learn more), but allow users to see that they can dig for more content.
Web Design | | johnshearer0