Redirecting index.html to the root
-
Hi, I was wondering if there is a safe way to consolidate link juice on a single version of a home page. I find incoming links to my site that link to both mysite.com/ and mysite.com/index.html. I've decided to go with mysite.com/ as my main and only URL for the site and now I'd like to transfer all link juice from mysite.com/index.html to mysite.com/
When i tried 301 redirect from index.html to the root it created an indefinite loop, of course.I know I can use a RewriteRule.., but will it transfer the juice??
Please help!
-
@streamlinemetrics this worked for my site Finbit Solutions, too! Thank you very much!
-
It works good for my site https://uaedesertsafari.com/
-
works, thank you!
-
Thank you very much, this works fine with me.
-
Google may see this as a 301 but MOZ crawl does not seem to.
Can you please help explain this?I am looking for a good .htaccess code for this redirect.
-
Thank you, Streamline Metrics. I looked everywhere and tried several different edits in my htaccess for a 301 redirect from index.html to root, but none worked. Your code worked wonderfully.
-
that seems to be working well. thanks a lot for your help.
-
If you want to redirect all index.html(s) to their roots, then try this code -
RewriteEngine On
RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]And yes, Google will treat them as 301 redirects so your juice will be transferred and consolidated.
-
thanks, that was quick!
A couple of questions before i go ahead and implement it:will this rule re-direct all index.html(s) to their appropriate roots or will it work just for the home page?
Also, as far as user's expirience is concerned this will take care of redirecting requests to show index.html to the root, but what about the juice transfer. Will Google treat it as 301? -
It's definitely a good idea to 301 redirect index.html to your root to consolidate link juice. I am assuming you have an .htaccess file so the following lines should work -
RewriteEngine On
RewriteBase /redirect html pages to the root domain
RewriteRule ^index.html$ / [NC,R,L]
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
-
Does redirecting a duplicate page NOT in Google‘s index pass link juice? (External links not showing in search console)
Hello! We have a powerful page that has been selected by Google as a duplicate page of another page on the site. The duplicate is not indexed by Google, and the referring domains pointing towards that page aren’t recognized by Google in the search console (when looking at the links report). My question is - if we 301 redirect the duplicate page towards the one that Google has selected as canonical, will the link juice be passed to the new page? Thanks!
Intermediate & Advanced SEO | | Lewald10 -
My url disappeared from Google but Search Console shows indexed. This url has been indexed for more than a year. Please help!
Super weird problem that I can't solve for last 5 hours. One of my urls: https://www.dcacar.com/lax-car-service.html Has been indexed for more than a year and also has an AMP version, few hours ago I realized that it had disappeared from serps. We were ranking on page 1 for several key terms. When I perform a search "site:dcacar.com " the url is no where to be found on all 5 pages. But when I check my Google Console it shows as indexed I requested to index again but nothing changed. All other 50 or so urls are not effected at all, this is the only url that has gone missing can someone solve this mystery for me please. Thanks a lot in advance.
Intermediate & Advanced SEO | | Davit19850 -
Need advice on redirects
Hi, I have new web addresses for my subpages. None if them have external links. Should I do redirects to the new pages or just leave the old pages in 404 and let google crawl and rank the new page. I am asking because my current pages don’t have a good ranking and I am thinking starting with a clean url is better. Thank you,
Intermediate & Advanced SEO | | seoanalytics1 -
Choosing root domain for a subdomain
We own two root domains in the .edu space. According to Open Site Explorer, one has a domain authority of 76, while the other has a DA of 94. We operate a collection of degree microsites as subdomains of the lower-ranking root domain, e.g. www.degreename.domain76.edu. All other things being equal, would these sites benefit if we migrated them to www.degreename.domain94.edu? The question seems to hinge on whether subdomains inherit any of the root domain's authority, and the answers I have seen to that question are "sometimes" and "maybe". Lastly, as an alternative, would we realize greater SEO improvements by moving the degrees to a directory structure under domain94, i.e. www.domain94.edu/degrees/degree-name? Thank you for your help!
Intermediate & Advanced SEO | | UWPCE0 -
Should i redirect this page?
Hi I have the following 2 pages: http://www.over50choices.co.uk/Funeral-Planning.aspx http://www.over50choices.co.uk/Funeral-Planning/Funeral-Plans.aspx My dilema is that google sees the words "funeral planning" & "funeral plans" as the same thing, which might explain why the "funeral plan" page is not ranked v well. My issue is that the "funeral planning" page is at category level and introduces the wider subject of funeral planning, which isnt just funeral plans, so if i 301 my "funeral plan" page i will have no where to talk about funeral plans. My question is, Is the "funeral plan" page not ranked v well because of this or do i just need better optimisation of the funeral plan page so google is clear which is the key focus for each page? Thanks Ash
Intermediate & Advanced SEO | | AshShep10 -
Drop in indexed pages!
Hi everybody! I've been working on http://thewilddeckcompany.co.uk/ for a little while now. Until recently, everything was great - good rankings for the key terms of 'bird hides' and 'pond dipping platforms'. However, rankings have tanked over the past few days. I can't point my finger at it yet, but a site:thewilddeckcompany.co.uk search shows only three pages have been indexed. There's only 10 on the site, and it was fine beforehand. Any advice would be much appreciated,
Intermediate & Advanced SEO | | Blink-SEO0 -
301 redirect Actinic HTML pages to ASP. Achievable?
Hi - I'm hoping someone can help me resolve an issue in relation to setting up 301 redirects. The client to whom I provide SEO services is being told by his developers that setting up 301 redirects is not achievable from old HTML pages to his new site running on a Windows server. My feeling is that it should be fine, and I have found documentation online that seems to support this, however I'm no developer, certainly no server admin, so I was wondering if anyone could advise me? Is it feasible to set up 301 redirects from Actinic sites (HTML pages) to a new site in NOP commerce running on a Windows server (ASP pages). Thank you for your help! Iain
Intermediate & Advanced SEO | | Wynyard0 -
Ranking with other pages not index
The site ranks on page 4-5 with other page like privacy, about us, term pages. I encounter this problem allot in the last weeks; this usually occurs after the page sits 1-2 months on page 1 for the terms. I'm thinking of to much use the same anchor as a primary issue. The sites in questions are 1-5 pages microniche sites. Any suggestions is appreciated. Thank You
Intermediate & Advanced SEO | | m3fan0