How do I redirect index.html to the root / ?
-
The site I've inherited had operated on index.html at one point, and now uses index.php for the home page, which goes to the / page. The index.html was lost in migrating server hosts.
How do I redirect the index.html to the / page? I've tried different options that keep giving ending up with the same 404 error. I tried a redirect from index.html to index.php which ended in an infinite loop. Because the index.html no longer exists in the root, should I created it and then add a redirect to it? Can I avoid this by editing the .htaccess?
Any help is appreciated, thanks in advance!
-
The 301 should be outside the <ifmodule>. Maybe you could post the other 301 redirects and the one which isn't working here.</ifmodule>
Creating a new index.html and redirecting from it would give you a 302 or even a meta-redirect, which in regard to seo is not recommended.
-
I have some re-write rules for Wordpress, which are contained within <ifmodule>tags. And below those I have some redirect 301s. I placed the code after the Wordpress re-writes, and then tried to place them at the end, past the 301 redirects, and still I receive a 404 on the index.html.</ifmodule>
Is there anything else I could be doing? Should I create a new index.html and place a redirect within there?
-
Do you allready have some rewrite-rules in yout htaccess? In this case try placing it at the end of them.
Works without any tags for me.
-
I pasted the code into my .htaccess, and still receive a 404 for index.html. Must it be placed within module tags? Does the position of placement matter? Thanks for the quick reply, btw.
-
Pascal,
chrwald is referring to a 301 redirect, which is safe for seo and should not result in an infinite loop. I've done this myself to redirect the .index.html to the root so that duplicate content would not appear. -
Hi Pascal,
Try this in you htaccess
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
RewriteRule ^index.html$ http://YOURDOMAIN.COM/ [R=301,L]
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
-
Help Center/Knowledgebase effects on SEO: Is it worth my time fixing technical issues on no-indexed subdomain pages?
We're a SaaS company and have a pretty extensive help center resource on a subdomain (help.domain.com). This has been set up and managed over a few years by someone with no knowledge of SEO, meaning technical things like 404 links, bad redirects and http/https mixes have not been paid attention to. Every page on this subdomain is set to NOT be indexed in search engines, but we do sometimes link to help pages from indexable posts on the main domain. After spending time fixing problems on our main website, our site audits now flag almost solely errors and issues on these non-indexable help center pages every week. So my question is: is it worth my time fixing technical issues on a help center subdomain that has all its pages non-indexable in search engines? I don't manage this section of the site, and so getting fixes done is a laborious process that requires going through someone else - something I'd rather only do if necessary.
Technical SEO | | mglover19880 -
IP Redirect causing Indexing Issue
Hi, I am trying to redirect any IP from outside India that comes to Store site (https://store.nirogam.com/) to Global Store site (https://global.nirogam.com/) using this methodThis is causing various indexing issues for Store site as Googlebot from US also gets redirected!- Very few pages for "store.nirogam.com/products/" are being indexed. Even after submission of sitemap it indexed ~50 pages and then went back to 1 page etc. Only ~20 pages indexed for now.- After this I tried manually indexing via "Crawl -> Fetch as Google" - but then it showed me a redirect to global.nirogam.com. All have their "status -> Redirected" - This is why bots are not able to index the site.What are possible solutions for this? How can we tell bots to index these pages and not get redirected?Will a popup method where we ask user if they are outside India help in solving this issue?All approaches/suggestions will be highly appreciated.
Technical SEO | | pks3330 -
Ranking and Indexing Issue
We have an established site www.getinspired365.com that previously wasn't SEO optimised. We are currently in the process of testing out some new pages to see if we can get them to rank in Google, however we are seeing huge fluctuations in where they rank. Within the first few days we saw our page rank on the first or second page, however it has now dropped out of the top 250 search results. We are wondering if we have made any mistakes with our optimisation ? Example Page : Keyword to target - "If you laugh, you think, and you cry, that's a full day. That's a heck of a day. You do that seven days a week, you're going to have something special." URL : http://www.getinspired365.com/if-you-laugh-you-think-and-you-cry-thats-a-full-day-thats-a-heck-of-a-day-you-do-that-seven-days-a-week-youre-going-to-have-something-special We can see it has been indexed by Google but is now not ranking in the top 250 search engine results. We have run the On Page Grader from SEOMoz and it ranks the page as an "A" so we suspect that we are doing the SEO ok on the page, but can't work out why it isn't ranking, despite ranking on the first or second page after a few days ? We have other pages that aren't SEO optimised that rank better than our newly SEO optimised pages e.g. Keyword - "THE BEST LOVE IS THE KIND THAT AWAKENS THE SOUL AND MAKES US REACH FOR MORE, THAT PLANTS A FIRE IN OUR HEARTS AND BRINGS PEACE TO OUR MINDS. AND THAT'S WHAT YOU'VE GIVEN ME. THAT'S WHAT I'D HOPED TO GIVE YOU FOREVER" URL: http://www.getinspired365.com/20130528 Any advice you could offer would be great. Thanks ! Mike
Technical SEO | | MichaelWhyley0 -
Redirect of https:// to http:// without SSL. Possible or not?!
Good afternoon, smart dudes : ) I am here to ask for your help. I posted this question on google help forum and stackoverflow, but looks like people do not know the correct answer... QUESTION: We used to have a secured site, but recently purchased a separate reservation software that provides SSL (takes clients to a separate secured website) where they can fill out the reservation form. We cancelled our SSL (just think its a waste to pay $100 for securing plain text). Now i have so many links pointing to our secured site and i have no idea how to fix it! How do i redirect https://www.mysite.comto http://www.mysite.com.Also would like to mention that i already have redirect from non www to www domain (not sure if that matters): RewriteEngine onRewriteCond %{HTTP_HOST} ^mysite.com$ [NC]RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]As i already mentioned....we do not have SSL!!!! None of those 301 redirect codes i found online work (you have to have SSL for the site to be redirected from https to http | currently i get an error - can't establish a secured connection to the server ). Is there anything i can do???? Or do i have to purchase SSL again?
Technical SEO | | JennaD140 -
Why are URLs like www.site.com/#something being indexed?
So, everything after a hash (#) is not supposed to be crawled and indexed. Has that changed? I see a clients site with all sorts of URLs indexed like ... http://www.website.com/#!category/c11f For the above URL, I thought it was the same as simply http://www.website.com/. But they aren't, they're getting indexed and all the content on the pages with these hash tags are getting crawled as well. Thanks!
Technical SEO | | wiredseo0 -
Removing a staging area/dev area thats been indexed via GWT (since wasnt hidden) from the index
Hi, If you set up a brand new GWT account for a subdomain, where the dev area is located (separate from the main GWT account for the main live site) and remove all pages via the remove tool (by leaving the page field blank) will this definately not risk hurting/removing the main site (since the new subdomain specific gwt account doesn't apply to the main site in any way) ?? I have a new client who's dev area has been indexed, dev team has now prevented crawling of this subdomain but the 'the stable door was shut after the horse had already bolted' and the subdomains pages are on G's index so we need to remove the entire subdomain development area asap. So we are going to do this via the remove tool in a subdomain specific new gwt account, but I just want to triple check this wont accidentally get main site removed too ?? Cheers Dan
Technical SEO | | Dan-Lawrence0 -
GWT and html improvements
Hi all I am dealing with duplicate content issues on webmaster tool but I still don't understand what's happening as the number of issues keeps changing. Last week the duplicate meta description were 232, then went down to 170 now they are back to 218. Same story for duplicate meta title, 110, then 70 now 114. These ups and downs have been going on for a while and in the past two weeks I stopped changing things to see what would have happened. Also the issues reported on GWT are different from the ones shown in the Crawl Diagnostic on Moz. Furthermore, most URL's have been changed (more than a year ago) and 301 redirects have been implemented but Google doesn't seem to recognize them. Could anyone help me with this? Also can you suggest a tool to check redirects? Cheers Oscar
Technical SEO | | PremioOscar0 -
301 Redirects
Last year we merged 3 websites into 1 website and launched the new site in February. When developing the new site I created 301 redirects for all the pages from the old sites to the new site. Unfortunately when the new website was created the URLs were not optimised for search engines. I now need to optimised the page URLs. In theory I need to create new 301 redirects from this existing pages to the new optimised URLS. I am concerned that in a few years I might end up with a string of 301 redirects and if I break some links I might loose some ranking. How many redirects will link juice work for? I hope I'm clear here, if not I've attached a image showing what I'm doing. Thank you. unledfh.jpg
Technical SEO | | Seaward-Group0