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
-
Is it a good practice to reduce number of redirections (301) after a period of time?
Is it good to use disavow tool and get rid of old URLs i.e. links for pages and posts which we have deleted from our website and added 301 on them?
On-Page Optimization | | Ravi_Rana0 -
301 vs 410
Hello everyone! I'm going through a large list of old 404 links that search console has given me and a lot of these links need to be 301'd. My question is, should I 410 some of these links if I can't find a good place to 301 to? Or is there another thing I should do that is better practice. Thanks!
On-Page Optimization | | KathleenDC0 -
How do you find domains with good PA/DA?
I am looking for a domain with a good PA/DA but I cant find a list of relevant domains that are decent. Does anyone know any website that can be used to make the search a bit easier?
On-Page Optimization | | trobs24680 -
Should I "No Index" Certain Pages On My Site?
I have some pages on my site that don't really have any content other than some iframes that are embedded from another site. I thought it would be best to tag the page with a no-index so that search engines would leave the page alone since it has no content as far as the search engine can tell (but does provide value to my site visitors). Is this the proper approach or does it do more harm than good?
On-Page Optimization | | Kyle Eaves0 -
What is the right schema.org link for a web design / developer / mobile agency?
It seems strange that a group of web developers would make up an entire structured language to designate businesses by category and somehow forget to include companies like.... web developers. So I must be missing it, what is correct to use?
On-Page Optimization | | yeagerd0 -
Will Google re-index the page if content is changed/improved?
Hello,
On-Page Optimization | | wickedsunny1
i have a little question, it seems most of my posts which are 3 years old or even more, all have almost same type of 2-3 lines of text at post starting and then images roundups etc.
which recently stopped getting any traffic from google. Probably becuase of lack in text etc.
So if i now edit those old pages, will they be reindexed in google with this new content/data?
thanks in advance.
cheers0 -
Why does http://www.southernhearth.com rank so well for patio furniture and outdoor furniture?
I was looking at the competitiveness of ranking for the keywords "patio furniture" & "outdoor furniture" and was shocked to see www.southernhearth.com ranking so well. While I am just getting into the research, I was unable to see anything that would justify it's rank. What are your thoughts?
On-Page Optimization | | Mattbyo0 -
How to make google not index quotes from other sites?
Hey guys, I have a site where we post quite a lot of info from other sites. We don't want google to de-index our pages because parts of it are quotes from other sites. What would you use to make it so Google sees it's a quote from another site? Or to just make Google not index the quote? Thanks!
On-Page Optimization | | StefanJDorresteijn0