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
-
App indexing with several subdomains
Hi, We are currently in the process of getting our app developed. From an SEO point of view I want the app to get indexed and am currently trying to get a step by step guide for it. I've come across this helpful guide: https://moz.com/blog/how-to-get-your-app-content-indexed-by-google but need to go a bit deeper now. Questions I have is related to the "apple-app-site-association" file As far as I could find out the JSON code of that file has the following syntax: {_ “applinks”: {__ “apps”: [],__ “details”: [__ {__ “appID”: “9JA89QQLNQ.com.my.bundle.id“,__ “paths”: [ “/myPath1”, “/myPath2/*” ]__ },__ ]__ }_ } My question is related to the key "appID" I'm wondering how the entry would look like if I have 10 country subdomains and would like to make sure that the deep link clicked in the browser is going to the right subdomain page within the app. Current website structure:
Web Design | | FashionLux
uk.example.com/english-path/
de.example.com/german-path/ Many Thanks in advance0 -
Can forwarding users from one domain to a different domain damage rank and authority of first domain?
Preliminary Explanation: We launched a new website a couple months back but haven't had much luck in Google taking notice. One of the main attractions to our site is an old flash app that was made nearly a decade ago. As the original developer has long ago moved on and we are unable to figure out how to integrate it with our new site, we've been stuck hosting the flash app on a different domain. As such, users who come to our site and want to use the app must immediately navigate away from our site to this other domain. This has caused our primary domain's bounce rate and average site time to plummet while raising it for the other domain. My question: is this damaging our search rank and page authority with Google for this primary domain/site and counter-acting any other positive SEO changes we can make? How much weight does Google give towards bounce rate/average site time spent by users in its overall calculations for search rank and page authority? Our average site time for this primary domain is resting currently at 50-60 seconds, while for the secondary domain that hosts the old flash app it is 4-5 minutes.
Web Design | | Closetstogo0 -
Using Multiple links/names for the same product?
I am being asked to change these product links on the home page: Home/Condo
Web Design | | RoxBrock
Watercraft/Boat to Home
Condo
Watercraft
Boat (Along with several other product links) How does this affect the customer experience/usability, and SEO? Is it a good idea or is it confusing? Thank you.0 -
Is it possible to move a couple of posts and comments from one WP domain to another
Hi, We want to move a couple of dozen articles from one of our self-hosted wordpress website to another self-hosted Wordpress website. Is there a way to this such that the following content is also included in the migration:
Web Design | | seocuppa
1. Post content (including images and meta if possible)
2. Comments Do note the older site from which we want to move out the content has more than 2000 posts and we just want to move 60-70 posts. Thanks.0 -
Domain Consolidation & Proper Linking Strategy?
We have a client that operates 5 gyms in 5 different part of Miami, and each gym has its own website. All sites rank well and have a a good pagerank. For the purpose of their marketing and brand they would like 1 website developed which includes all of their gyms which we are launching later today. Each gym will have it's own landing page within the website Should we redirect the URL's of the different websites to the individual landing pages on the new site or how should that work to minimize any penalties on our SEO. For example (these are fake url's): www.gymA.com, www.gymB.com, www.gymC.com, www.gymD.com The new url: www.gym.com New landing pages:
Web Design | | POPCreative
www.gym.com/gymA, www.gym.com/gymB, www.gym.com/gymC, www.gym.com/gymD Should we do a redirect from: www.gymA.com to www.gym.com/gymA www.gymB.com to www.gym.com/gymB www.gymC.com to www.gym.com/gymC www.gymD.com to www.gym.com/gymD Thank you in advanced. If there is a better way to do this, or anything extra I need to know, that would be great. Thanks!0 -
Linking root and domain authority
Hi SEOMOZ community, Can you please advise on how to increase Linking root domains and domain authority. much appreciated.
Web Design | | wahin10 -
Site Change / CMS Change
Hi Guys I have a very good client with whom we have been working with for over 2 years. When we 1st arrived, their website was built in Wordpress. During our SEO, the dleted the site and changed it to Drupal over night. Youc an imagin i went balistic and its been a horrid year in getting all the rrors down and redirects etc. Finally done I have just been informed that they will be deleting the website from Drupal to Joomla again! This is crazy as we have finally fix all the rrors and are driving quality traffic to the site. Now its back to square one... What do i do? ps the change from Drupal to Joomla is due to MYSQL issues
Web Design | | stefanok0 -
How long will the 301 ranking swap-over take?
Hi all, I'm about to hit the crunch button and finalise the 301 setup for our website to redirect all traffic, and our old very nice ranking, to our new website. My only question is, how long will the ranking take to move to the new site? Once the 301 is in place what happens when someone searches my keywords? Currently when you search our preferred keywords we rank 1 and 2 depending on the wording. Once I've made the 301 happen, will you see the old site in Google rankings until they re-index it or will it swap straight away to the new site with its continued high rank (from the link juice) or will I have a blackspot period where I don't rank at all? I cannot afford to have a period of time, at this time of year, that I don't rank 1 or 2 - if this is even a vague possibility I might have to consider postponing my 301 till a less important time of year. Thanks for your help, Anthony
Web Design | | Grenadi0