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
-
My site auto redirects http to https. This is causing redirect chains. What can I do?
I noticed that Moz flags a lot of redirect chain issues on my site. I realized that this is mostly because the site automatically redirects http to https, and when I create a new URL (when a URL changes, for example) it is automatically flagged as a chain. Example: http://www.example-link Auto directs to: https://www.example-link Which is then redirected to: https://www.example-link-changed (when the address actually changes) I don't seem to have any control over changing where the initial http redirect goes. Any advice on fixing this problem?
On-Page Optimization | | baystatemarketing0 -
301 and the base URL
Hi, please bear with me as I'm pretty new to all this! I've my base URL but obviously want to add keywords to it for seo purposes. Should I redirect from the base URL to the URL with the keywords appended? So my landing page goes from say www.moz.com to www.moz.com/keywords-here. If I do that, should I replicate all the meta data (descriptions etc) on the original landing page? Or does it not matter? Thanks, Nick
On-Page Optimization | | nickwoodward0 -
How/when do you trim your article pages?
Hi all, I wanted to ask what have you all done to your article section that has made a difference to the site's SEO performance? What's the criteria for deciding which articles top cut or 301 redirect to the main page For example: 1. you have a slightly irrelevant article to your website topic, low conversions, but a lot of quality links to page, but no primary keywords in article title. 2. You have a slightly irrelevant article to your website, low conversion, but a lot of quality links AND you have your site's primary keywords in article title 3. You have a relevant topic to the site, but low engagement and low conversions Thanks for all your help!
On-Page Optimization | | SDavis111 -
Page/Website Structure
Hello again Mozzers, We have a category, lets call it widgets. Within widgets are about a hundred or so products. For usability my predecessor made the following layout Widgets Main Cateogry - Links off homepage - (no content just links to the 3 sub-categories)
On-Page Optimization | | ATP
- Widgets by Resolution
---- About 20 subcategories
eg. 0.1 Resolution widgets
0.2 resolution widgets
- Widgets by Capacity
---- About 20 subcategories
eg. 1 capacity widgets
2 capacity widgets
- Widgets by Type
---- About 12 subcategories This was a major improvement from a userbility perspective as it made a very complex product range navigatable by the major features or basic type. However, as you can imaging we now have 60+ very similiar pages all displaying very similiar products a nightmare for SEO. It also isnt ideal for user navigation as it take too many clicks to get to the products. I propose the following fix, and i wanted your opinion. Widget Main Category - Link from homepage (Consolidated with Widgets by Type)
-300 Words of content
-Links to the 12 Sub-type Catoregies (These are pages i can fill with content + products. This would give me a more ordinary structure of which I can focus each page to a keyword) The tricky part comes with incorporating the capacity and resolution options. 1 Browse Capacity Page
(20 sub categories all the same except capacity quantity & products)
1 Browse by Resolution Page
(20 sub categories all the same except resolution value & products) The owner want them, I was going to link from the main widgets page to each of these to give the customer the option. What I can't decide is how to deal with them from an SEO point of view. Should they be no-followed? canonicaled? Can there be any advantage to having so many pages covering slightly different variations or as i suspect it is dangerous to the overall health of the site. To complicate things further, Canonical tags may not be an option due to an old magento version running that doesnt support them. Is there an alternative way around? As always many thanks.0 -
Reverse 301 redirect - how will that work?
Hi We have done some testing where we have changed our URL to a new name and 301 redirected the old to the new. It has now been decided to go back to the old url again but is there an seo risk to this? Will all the inbound links that as redirected in the first change be lost or?
On-Page Optimization | | AndersDK0 -
Boatload of 301 Redirects Question
We have a client that came to us and they recently did a site makeover. Previously they had all their pages in root directory including 75+ spammy article pages. On their makeover, they moved all the article pages into a directory and added 301 redirects. In going over their site we noticed they have redundant articles, like an article on blue-marble-article.htm and blue-marbles-article.htm Playing on singular and plural with dulpicate content for most part with exception to making it plural. If they have 75 articles, Id say 1/3 are actually somewhat original content. I would like to 301 redirect 2/3's of the articles to better re-written article pages but that would add a whole lot more 301 redirects. We would then have a 301 redirect from root directory to article directory, then another 301 redirect from spam article to new re-written article. My question is, would this be too many redirects for googlebot to sort through and would it be too confusing or send bad signals? Or should I create a new directory with all good articles and just redirect the entire old articles directory to the new one? Or just delete the redirects and old spammy directory and let those fall on a 404 error page. Id hate to lose 50-75 pages but I think its in fact those spammy pages that could be why the site fell from top of first page google to third page and now 10th page in a years time. I know, Im confused just typing this out. Hope it makes sense for some good feedback and advise. Thanks.
On-Page Optimization | | anthonytjm0 -
Redoing a site - 404 redirect or 301 redirect
I'm redoing a website, should i 404 the old pages, or 301 redirect to the main page? what is better? (around 100 pages)
On-Page Optimization | | mkmedia0 -
The crawl diagnosis indicated that my domain www.mydomain.com is duplicate with www.mydomain.com/index.php. How can I correct this issue?
How can I fix this issue when crawl diagnosis indicated that my www.mydomain.com is duplicate with www.mydomain.com/index.php? That suppose to be the same page and not duplicate, right?
On-Page Optimization | | jsevilla0