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
-
Multiple websites for different service areas/business functions?
I'm wondering what the implications are for having multiple domains for different service areas of a company? I realize having multiple domains for one company can be troublesome because of the possibility of duplicate content, keyword cannibalization, and linkbuilding to multiple domains. But when the domains are for very different service offerings/unique business functions that each serve their own purpose (and have different positionings), is there a downside to having more than one domain? Any thoughts would be appreciated!
Web Design | | KevinBloom0 -
SEO Value to Improving HTML Code of Website That Validates According to W3C?
Greetings MOZ Community: My real estate website www.nyc-officespace-leader.com, originally designed in Drupal, was relaunched using Wordpress in 2013. The code for all URLs validates. The relaunch was performed by developers in Argentina. As part of an SEO campaign, I very reputable design/coding company in the has provided new wire frames to correct useability issues holding back conversions. In the course of the design adjustments they inspected the code and have told me that it is inefficient, that a number of shortcuts were taken and that the code does not conform to Wordpress best practices. What concerns me most is their claim that the quality of coding makes it more difficult for Google to index the site and this may be detrimental to ranking. Is it possible for the original developers to clean up this code if the deficiencies are pointed out to them? Or once coding shortcuts are taken are they impossible to fix? Would it make sense for me to request that the new design team put together a list of HTML deficiencies and provide to the original developers and ask them to correct? I am spending tens of thousands of dollars on content optimization, content marketing. It would be absurd if these coding issues would ultimately prevent improvement in ranking and traffic. At the same time, I hate to be a cynic but the domestic design/coding firm, while being very professional, does have an incentive in getting me to ditch the original design so I commit to an costly rebranding. If these issues are really minor maybe it is not worth making the effort to clean up the code (assuming that is even possible) and focus the budget on content marketing. Any thoughts?
Web Design | | Kingalan10 -
Does Google count the domain name in its 115-character "ideal" URL length?
I've been following various threads having to do with URL length and Google's happiness therewith and have yet to find an answer to the question posed in the title. Some answers and discussions have come close, but none I've found have addressed this with any specificity. Here are four hypothetical URLs of varying lengths and configurations: EXAMPLE ONE:
Web Design | | RScime25
my-big-widgets-are-the-best-widgets-in-the-world-and-come-in-many-vibrant-and-unique-colors-and-configurations.html (115 characters) EXAMPLE TWO: sample.com/my-big-widgets-are-the-best-widgets-in-the-world-and-come-in-many-vibrant-and-unique-colors-and-configurations.html (126 characters) EXAMPLE THREE: www.sample.com/my-big-widgets-are-the-best-widgets-in-the-world-and-come-in-many-vibrant-and-unique-colors-and-configurations.html (130 characters) EXAMPLE FOUR: http://www.sample.com/my-big-widgets-are-the-best-widgets-in-the-world-and-come-in-many-vibrant-and-unique-colors-and-configurations.html (137 characters) Assuming the examples contain appropriate keywords and are linked to appropriate anchor text (etc.,) how would Google look upon each? All I've been able to garner thus far is that URLs should be as short as possible while still containing and contextualizing keywords. I have 500+ URLs to review for the company I work for and could use some guidance; yes, I know I should test, but testing is problematical to the extreme; I look to the collective/accumulated wisdom of the MOZVerse for help. Thanks.1 -
How do I move a 200+ website properly with 301 redirect?
I tried to search for the answer but didnt find any direct answers. I need to move a 200+ site to a wordpress site. How am I suppose to 301 redirect all of them? Do I need to create the new pages first then have webmaster use ssh and 301 the entire list? Can anyone link me to a 1,2,3 step instructions for a huge website move? Im sure there are other issues that I need to know about.
Web Design | | bryonstout0 -
So apparently SEO moz will get us de-indexed according to a SEO company!
Each and every day i get called up from an SEO company who promises to get me top spots in Google rankings if i quickly get on their special offer they have today normally i would say "no thanks and put the phone down" but i had a bit of spare time so i indulged the guy and we got talking. After the introductions and speal about his company he was showing me what his company does and how they go about it to get me top ranks (they don't get me ranks but create a website they own which then passes leads to me- kinda clever since they could then start charging me per lead or my competitors) We continued to talk and i mentioned i used SEOmoz to check my rankings and back links etc and he told me that Google are cracking down and anyone using these types of software/websites will get their websites de indexed. This struck me as BS but i wanted to get your thoughts on the matter, i personally don't believe Google would ever do such a thing as this since it would be so easy to get your competitors websites taken down (i.e. negative seo) but its certainly a talking point.
Web Design | | GarethEJones0 -
Need to rebuild client's flash website
I am working with their web designer and need to figure out a way to rebuild their site which is currently all in flash. I was wondering if there was a way to do this without spending a ton of time in completely re-doing the site from scratch.
Web Design | | awalker840 -
Alternatives to Wordpress for updating content of a static html site
I have a static html site which I cannot update myself. What solutions/ programs would you recommend for gaining the ability to update it myself? I'm reluctant to switch to WordPress because the sites that use any CMS that are hosted by my web hosting company get routinely hacked. Thank you!
Web Design | | translate0 -
Separate .mobi site or make .com site mobile friendly?
Our website now has enough mobile traffic to justify going mobile friendly, which it is not at this time. I am in favor of making a separate .mobi site designed specifically for mobile phones and smart phones for several reasons. It is cheaper, faster, and easier to accomplish. I think our mobile users will have a good experience though obviously not as much info as our full site. I would use ourdomain.mobi with link or a redirect for mobile users from from the main site. My top three choices for implementing that are http://allwebcodesign.com/setup/mobi-templates.htm#detailsarea
Web Design | | zharriet
Template that can be viewed by mobile or desktop. http://www.onbile.com/ http://www.networksolutions.com/mobile-website/index.jsp Does this seem like a good solution?1