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
-
Index or No Index (Panda Issue)
Hi, I believe our website has been penalized by the panda update. We have over 9000 pages and we are currently indexing around 4,000 of those pages. I believe that more than half of the pages indexes have either thin content. Should we stop indexing those pages until we have quality page content? That will leave us with very few pages being indexed by Google (Roughly 1,000 of our 9,000 pages have quality content). I am worried that we would hurt our organic traffic more by not indexing the pages than by indexing the pages for google to read. Any help would be greatly appreciated. Thanks, Jim Rodriguez
On-Page Optimization | | dustyabe0 -
Wordpress / Full URL In Menu Box
I came across an article online (not Moz) that says adding the full url in a menu is a Google standard. So when you make a menu link you put "www.example.com/page" instead of "/page". What are your thoughts on this? Any real reason to? Y840pbN lrwZPDj
On-Page Optimization | | InfinityTechnologySolutions0 -
Sudden Drop in Rankings/Traffic/Organic Impressions Without a Penalty
Hi Moz community! I have a question about a local client in Raleigh, NC - http://paragonbuildinggroup.com This client came to us from another agency who had previously not done such a great job with the design/development of the site, or with the marketing of it, so we are somewhat limited in terms of what we can do on design, user experience, etc. But, the SEO is all still easy to tweak and we've been working on it for some time now. As of July 5th, their keyword rankings have dropped dramatically (we're talking from first page rankings to nothing, according to Authority Labs), and they've fallen completely off the map in the SERPs. Their local listing doesn't appear in search results anymore, and WMT is showing a drastic drop in impressions (from 457 on July 3rd to 92 on July 5th). There have been no manual penalties on the site, no recent major development work done, and from what I can see, no signs of hacking and no bad backlinks. The only thing I can see is that Mozcast showed an 83 degree day with some clouds and rain on July 5th, the day that our rankings dropped off, but I can't find any documentation showing what might have changed. Any insight as to what might be going on? I'm completely stumped!
On-Page Optimization | | TriMarkDigital0 -
What is the best way to execute a geo redirect?
Based on what I've read, it seems like everyone agrees an IP-based, server side redirect is fine for SEO if you have content that is "geo" in nature. What I don't understand is how to actually do this. It seems like after a bit of research there are 3 options: You can do a 301 which it seems like most sites do, but that basically means if google crawls you in different US areas (which it may or may not) it essentially thinks you have multiple homepages. Does google only crawl from SF-based IPs? 302 passes no juice, so probably don't want to do that. Yelp does a 303 redirect, which it seems like nobody else does, but Yelp is obviously very SEO-savvy. Is this perhaps a better way that solves for the above issues? Thoughts on what is best approach here?
On-Page Optimization | | jcgoodrich0 -
Modify URL, how to re-index
hello, I have just modified URL, do I need to re-submit sitemap or something else to search engines?
On-Page Optimization | | JohnHuynh0 -
Duplicate page content & title for www.mydomain.com and www.mydomain.com/index.php?
Hi, First post so please be gentle! My Crawl Diagnostics Summary is showing an error relating to duplicate page content and duplicate page title for www.mydomain.com and www.mydomain.com/index.php which are, in my view, the same thing/page? Could anyone shed any light please? Thanks Carl
On-Page Optimization | | Carl2870 -
Rename index.php or keyword in URL?
It is important for me to get good search results for keyword + city name For instance: tulips amsterdam What would be better: renaming index.php or adding the cityname to the URL? www.example.com/amsterdam/tulips OR www.example.com/pages/tulips-amsterdam
On-Page Optimization | | svdg0 -
Sitemap generator and /index.htm
I use DMX Zone sitemap generator in Dreamweaver. When generating the sitemap, it includes both http://www.domain.com and http://www.domain.com/index.htm. Should the /index.htm be deleted from the sitemap, or will the 301 redirect take care of that? Best,
On-Page Optimization | | ChristopherGlaeser
Christopher0