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
-
Https://www.fitness-china.com/leg-press-feet-placement youtube video affects website speed
In our blog, about Leg Press Feet Placement [https://www.fitness-china.com/leg-press-feet-placement](https://www.fitness-china.com/leg-press-feet-placement) we have added a lot of youtube videos to enrich the content of the article but we found that youtube videos affect the speed of the website, how to solve it
On-Page Optimization | | ahislop5740 -
.htaccess Question and Ranking
I have some basic rules set up in my .htaccess file and just curious as to the implications of them as I seem to have a website ranking very low on Search indexes for no particular reason that I can fathom. My question is a follows I have a htaccess rules set up in my application application that first strips the file suffix and then adds a closing brace for example Rule 1: http://www.domain.com/my_page.php becomes http://www.domain.com/my_page
On-Page Optimization | | ecrmeuro
Rule 2: http://www.domain.com/my_page becomes http://www.domain.com/my_page/ Will this rule expecially Rule 2 effect ranking or will these rule have no adverse affect on the website as my MOZ reports still seem to have pages listed win the Top Pages by PA section without the www? Below is an example of the htacess file. RewriteEngine On Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} /+[^.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L] Redirect non-WWW to WWW... RewriteCond %{HTTP_HOST} ^contractor-accounts.co.uk [NC]
RewriteRule ^(.*)$ http://www.contractor-accounts.co.uk/$1 [L,R=301] Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]0 -
Renamed a page and created a 301, page lost its rankings.
We changed a page name to fall under the root of our site from domain.com/page1/page301d/ to domain.com/page301d/ and after 2 weeks it still is not back to its #3 position. Now it is on the bottom of page 3. I cant figure out what im doing wrong here. The original .com/page1/ that this page fell under was removed totally and redirected to antoher page that was more relevant. I went ahead and re-enabled this page and its contnent, because the page was linking out to the page we 301d. This page we re-enabled had about 150 links poitning to it and therefore i was thinking that maybe the link juice from this page (or relevancy) via an internal link was helping it rank. This was updated about 6 days ago and the internal link is back Any other ideas why this might not be working. Ive checked all the 301s, content has not changed on the page. We have updated the strcuture for many pages. Instead of having the pages in question fall under anotehr page, they all fall under the root and its sub content is now only 2 levels deep , instead of being 3. hope that makese sense.
On-Page Optimization | | waqid0 -
Index SEO Performance
Hi guys, I was wondering if there is a difference in SEO performance between a page which ends with .html or just with a slash. For example: www.domain.com/test/ - www.domain.com/test.html Which one is better? And is there a difference between productpages and productcategory pages. Because we see mostly productpages ending with .html and category pages ending with a slash. Take a look at some big dutch companies like: http://www.coolblue.nl/
On-Page Optimization | | Happy-SEO
http://www.bol.com/
https://www.zalando.nl/ (product page) There are doing this with a reason.... i guess.... Thanks.1 -
To create extra pages, or not to create extra pages?
I'm responsible for a site where we cater for all kinds of medical & legal problems. I recently conducted keyword research that shows a lot of questions being 'asked' in relation to the conditions we cater for. Naturally, I want to create content to answer these questions. We have a page for 'Cancer compensation' - the 'possible content' that answers questions won't necessarily help someone claiming compensation for cancer mistreatment, BUT someone who asks a question relating to cancer, answered in the 'possible content' may find the 'cancer compensation' page useful. SO! Do I: Add this content to the existing 'cancer compensation' page? Create individual pages of content answering each question, linking to the 'cancer compensation' page? or do I amalgamate all the answers into one heafty 'resource' page that sits elsewhere on the site? What do you think? Thanks in advance. John King
On-Page Optimization | | Muhammad-Isap0 -
Homepage title on pages/posts title
I want to see the title of the page/post. Right now it is indexing it like page name / homepage name site:forumlist.info Brief info about site
On-Page Optimization | | csfarnsworth
Build in wordpress
SEO Plugin "All in one SEO pack" Settings snapshot are available below http://i.imgur.com/G278Y1Z.png http://imgur.com/gb0YQUO http://imgur.com/fbXQgd1 http://imgur.com/atj3AS4 Anyone can guide me how to fix it?0 -
WordPress and category/subcategory landing pages
Hey, Here's my situation. I'm building a WordPress blog for product reviews of a certain niche. Current category setup is 4 main categories with 4-8 subcategories each. Each subcategory has a unique description that will help it become a landing page for certain keywords, after which it lists the posts from that subcategory. The posts will always be assigned to a sub-category, never to a main category. My issue is what to do with the main categories. They're fairly general so they're not really targeting any keywords, and don't have any unique descriptions attached to them. I was thinking of choosing between three options on designing the main category pages: List the subcategories + normal posts loop that bring the latest posts from the subcategories (may create a lot of duplicate content since the subcategory pages are also listing their posts) List only the subcategories (+ maybe just the latest post from each subcategory) Don't link the main categories at all, instead only use them to create dropdowns for the subcategories So, what would you choose, and why?
On-Page Optimization | | mihaiaperghis0 -
Shall Google index a search result?
Hi, I've a website with about 1000 articles.Each article has one ore more keywords / tags. So I display these keywords at the article page and put a link to the intern search engine. (Like a tag cloud) The search engine lists als articles with the same keyword and creates a result page. This result page is indexed by Google. The search result contains the title of the article, a short description (150-300 chars.) and a link to the article. So, Google believes, that there are about 5.000 pages instead of 1.000 because auf the link to the search result pages. The old rule was for me: More pages in Google = better. But is this still true nowadays? Would be a "noindex, follow" better on these search result pages? (Is there a way to tell Google that this is a search result page?) Best wishes, Georg.
On-Page Optimization | | GeorgFranz0