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
-
Sitemap indexing
Hi everyone, Here's a duplicate content challenge I'm facing: Let's assume that we sell brown, blue, white and black 'Nike Shoes model 2017'. Because of technical reasons, we really need four urls to properly show these variations on our website. We find substantial search volume on 'Nike Shoes model 2017', but none on any of the color variants. Would it be theoretically possible to show page A, B, C and D on the website and: Give each page a canonical to page X, which is the 'default' page that we want to rank in Google (a product page that has a color selector) but is not directly linked from the site Mention page X in the sitemap.xml. (And not A, B, C or D). So the 'clean' urls get indexed and the color variations do not? In other words: Is it possible to rank a page that is only discovered via sitemap and canonicals?
Intermediate & Advanced SEO | | Adriaan.Multiply1 -
Website dropped out from Google index
Howdy, fellow mozzers. I got approached by my friend - their website is https://www.hauteheadquarters.com She is saying that they dropped from google index over night - and, as you can see if you google their name, website url or even site: , most of the pages are not indexed. Home page is nowhere to be found - that's for sure. I know that they were indexed before. Google webmaster tools don't have any manual actions (at least yet). No sudden changes in content or backlink profile. robots.txt has some weird rule - disallow everything for EtaoSpider. I don't know if google would listen to that - robots checker in GWT says it's all good. Any ideas why that happen? Any ideas what I should check? P.S. Just noticed in GWT there was a huge drop in indexed pages within first week of August. Still no idea why though. P.P.S. Just noticed that there is noindex x-robots-tag in headers... Anyone knows where this can be set?
Intermediate & Advanced SEO | | DmitriiK0 -
Sub domain on root domain
Hello,
Intermediate & Advanced SEO | | dror999
I have a question that I can't find a good answer on.
I have a site, actually a "portal"/ "directory" for service providers.
Now, for start, we opened every service provider own page on our site, but now we get a lot of applications from those providers that thy want sites from their own.
We want to make every service provider his own site, but on sub domain url. ( they don’t mind… its ok for them)
So, my site is www.exaple.com
There site will be: provider.exaple.com
Now I have two questions:
1. can it harm my site in SEO?
2. if one from those sub domain , punished by google because is owner do "black hat seo" , how it will affect the rood domin? It can make the root domain to get punished?
Thanks!!0 -
Sitemaps: HTML and/or XML?
Can someone explain sitemaps, and if you need html and/or xml? I have a site with a few html sitemaps, one for products, one for categories. I have another site with just one xml sitemap for my entire site (which has massive pages, 600k+). Should I be dividing the site with massive pages into html sitemaps like my other site?
Intermediate & Advanced SEO | | WebServiceConsulting.com0 -
301 redirects.
Hi everyone, I am having some issues with an a few dynamic URLs that are not redirecting; Example: http://www.example.com/shop-online?page=shop.product_details&flypage=flypage_images.tpl&product_id=69164&category_id=303 I first tried to carry out a standard 301 which looked like this; Redirect 301 /longurlwith&category_id=303 http://www.example.com/new-url Which didn't work. After a little bit of research I added the following into the htaccess file; RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]RewriteRule ^/shop-online$(.*)$ http://www.example.com/shop-online$ [NE,L,R=301] Which caused the website to error 500 (Not cool). So now I am stumped. Any help would be really appreciated as I'm sure it's an easy fix but I can't quite my finger on it. Thanks in advance :).
Intermediate & Advanced SEO | | AduroLabs0 -
Indexing specified entry pages
Hi,We are currently working on location based info.Basically, when someone searches from Florida they will get specific Florida results and when they search from California they will specific California results.How does this location based info affect crawling and indexing?Lets say we have location info for googlebot, sometimes they crawl from a New York ip address, sometimes they do it from Texas and sometimes from California. In this case google will index 3 different pages with 3 different prices and a bit different text, and I'm afraid they might see these as some kind of cloaking or suspicious movement because we serve different versions of the page. What's the best way to handle this?
Intermediate & Advanced SEO | | SEODinosaur0 -
How do I 301 Redirect a complete folder?
Hi, I am want to delete a folder and all the contents. I then need to redirect anyone that is trying to reach a file in that folder to another page on my site. example: www.mydomain.com/folder/ (contains 50 pages) I want to delete the folder and all 50 pages. So if someone tries to reach www.mydomain.com/folder/page1.php the redirect would take them to a specific page on my site. Doing this to clean up old content. How would I do this on the .htaccess? I have redirected a page but not a folder. Thanks in advance! Force7
Intermediate & Advanced SEO | | Force70 -
How can I create a redirection on IIS?
Hi, I want to know how to create a server side 301 redirection on IIS7. I found on google the below details; IIS Redirect In internet services manager, right click on the file or folder you wish to redirect Select the radio titled "a redirection to a URL". Enter the redirection page Check "The exact url entered above" and the "A permanent redirection for this resource" Click on 'Apply' But couldn't find anything like that. Can anyone help me out. thanks & regards
Intermediate & Advanced SEO | | VipinLouka780