How do you create a 301 redirect for www.mysite..com/index.html in htaccess.
-
I understand that it is possible to create a 301 redirect for www.mysite..com/index.html to www.mysite.com. (as well as subdirectories.) How is this accomplished? My hosting company says that setting this up in htaccess will cause "Apache to geti into an infinite loop and the page won’t load." I have read on the forum that this is possible. Any help would be greatly appreaciated.
THanks. Perri
-
-
Unfortunately we have off-site links that point to directory/index.html
-
Firstly make sure you have no on-site references to index.html else you'll be distilling your link juice. Ensure all references to you home page are www.mysite.com/
For the redirect try the following:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
RewriteRule ^index.html$ http://www.mysite.com/ [R=301,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
-
Google Console returning 0 pages as being indexed
HI there, I submitted my site notebuster.net to Search Console over a month ago and it is showing 0 pages as being indexed under the index status report. I know this isn't right as I can see that in google alone by typing in (site:notebusters.net) there are 113 pages indexed. Any idea why this might be? Thanks
On-Page Optimization | | CosiCrawley0 -
Why are my pages de-indexed?
<form id="form-t3_37nfib9dz" class="usertext" action="http://www.reddit.com/r/SEO/comments/37nfib/why_were_my_pages_deindexed/#"> Hello all, I am very new to SEO. For some reason many of the pages on my site were de-indexed. Specifically the ones linked from this page: However other pages, like the ones linked from this page and this page were not de-indexed. http://www.lawyerconnection.ca/practice-areas/car-accident-injury-lawyers/[1] However the pages linked from this page were not de-indexed: http://www.lawyerconnection.ca/practice-areas/slip-and-fall-lawyers/[2] http://www.lawyerconnection.ca/podcastresources/[3] That first page itself was not de-indexed, just the site that it links to. It just happened today, so maybe I am jumping the gun but I doubt it. When I enter the page into google webmaster tools again and press fetch, one of the child pages, it re-indexes. What could be the problem here? I had someone re-write the content for every city but I have a feeling that there is less differences in the car accidents pages? Is this considered duplicated content do you think? Am I making some other mistake I can't think of? Is it just a one day blip (I doubt it) Let me know, thanks. </form>
On-Page Optimization | | RafeTLouis0 -
Why Google did not index exactly these 2 pages? Any ideas?
Dear Community, on 27th of July I relaunched my own website and submitted the sitemap as well I send the index-page to crawl it including all linked pages. Already the next day the new pages have been indexed. Today I checked them manually if they have been indexed. The result is that 2 of 13 pages have not been indexed, here marked in bold: http://inlinear.com/
On-Page Optimization | | inlinear
http://inlinear.com/suchmaschinenoptimierung-online-marketing.php
http://inlinear.com/design/
http://inlinear.com/design/printmedien-gestaltung.php
http://inlinear.com/design/corporate-design-und-corporate-identity.php
http://inlinear.com/design/corporate-raum-design.php
http://inlinear.com/webentwicklung/
http://inlinear.com/virtueller-rundgang-360grad-fotografie.php
http://inlinear.com/business-atlas-online-verzeichnis.php
http://inlinear.com/baudokumentation-bauueberwachung.php
http://inlinear.com/ueber-uns.php
http://inlinear.com/blog/
http://inlinear.com/kontakt/ The page "/design/" (which is the index.php of this folder should be the main-page because its about WEB DESIGN.
Should I create a copy and call it /design/web-design.php? May be Google prefers a meaningful URL than the index.php? So I put then a rel=canonical to web-design.php in my index.php? design/corporate-design-und-corporate-identity.php
The URL is a little long, but this should not be the reason? Or might be a reason that another page which is still in the index, but not online anymore (even redirecting to /design/) is still more dominant? Strange.... orshould I simply wait a little or try submitting these to sites manually to google? When checking Google Webmasters Tools Google tells me that just 3 pages have been indexed.
When I was checking which page is indexed or not I checked each URL with the site-search option:
site:inlinear.com/pageX.php ... when Google shows this page, it was a sign that it was indexed but why webmasters tools show up only 3 pages? (see screenshot) Do you have any ideas?
Thank You 🙂 indexed.png0 -
Redirecting to homepage ok?
I deleted a bunch of category pages (renamed mostly actually and thought they'd be auto redirected like my blog posts are but they weren't) so I used a plugin that reroutes any 404 page to the homepage. Is that the best thing to do in this situation? Google Webmasters says there are about 84 404-errors and this should get rid of those right? Is there anything SEO BAD about doing it this way?
On-Page Optimization | | dealblogger0 -
Remove internal site SERPS from Google Index?
1. Internal Serp pages did not have a robots meta tag 2. As a result, client site has thousands (~4,400) of internal site SERP pages in the Google index. 3. We added the NoIndex, Follow attribute to all internal SERPS 4. We Disallowed: domain.com/internal-search-operator in Robots.txt 5. No new SERP pages are being indexed, but the other 4000 something that were already there are still in the index weeks later. 6. The pages are dynamically created and still work, so I can't use the Remove Content tool from google, because the pages don't 404. Is there any way to get these pages out of the index besides just waiting and hoping google eventuall drops them? Thanks
On-Page Optimization | | delegator.com0 -
No Index help
Hi, I have alot of notices about webpages that are apparently blocked by no index robots, I look through the code on the site and cannot see any coding for this and am confused how to fix the problem. Help anyone?
On-Page Optimization | | Vetshopgroup0 -
Too many 301 redirects to home page - is this possible?
If a site has a bunch of 404’s that are basically old URL’s that no longer work and point to pages or documents that don’t exist anymore - Can someone clarify if it’s a problem when fixing a bunch of these 404’s to point them all to the home page? so if there is not really anywhere else that is applicable for the old broken URL, is it really a problem to 301 old pages to the site home page? I have read some different things on this recently on some different sites, so I just wondered what the latest thinking on this was….thanks...
On-Page Optimization | | inhouseninja0 -
Redirecting to a keyword-rich domain URL
It's best practice to choose a domain that has keyword in it. But if someone has just launched a website and the domain name does not have keyword, is it better to purchase a new domain name that has a keyword in the name and redirect existing domain to the new domain? Will that help SEO? (This just launched website does not have any traffic or links yet.)
On-Page Optimization | | Amjath0