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
-
SEO and auto login with redirect
Hi, we have a site where user we know (cookie-based) is automatic redirected to private internal page. Unknown guests are staying on the page google search sent them. The redirect is done with a 302 to the private page. When I examine organic search and landing pages in analytics I see that more than 50% of the landing pages are private pages (inaccessible for the google-bot). This is because analytics does not register the redirecting page, just the target page. Is this harmful to SEO that so many users are redirected to other pages, or is this data not available to google-bot. The google bots is not redirect since they do not have the correct credentials. Do chrome or analytics send such data back to Google search? Is better to manipulate analytics page track call to use the address of the redirecting page? Or maybe skip to redirect, and just render the private content on the orginal page?
On-Page Optimization | | Morten.Berg0 -
Strange google indexing behaviour
Hi all Looking for a second opinion on a strange issue with has occurred on my site. The site is a magento store and because I am using all the default merchant descriptions at the moment I have noindexed the product pages (there are 300k products, the plan is to rewrite the content as we go, starting with most popular sellers). The Gbot is blocked from the pages and all the products have header tag. We forgot to noindex the popular search terms page on the site and as a result google has indexed some search result pages - we may keep this open, not sure yet, We are seeing a very strange thing in the serps. Google has indexed the search result pages, as mentioned above, however, the description and title tag being used do not belong to that page, they belong to the product page the search result links to. If i do a search in google for the indexed pages i get the categories and lots of, what appears to be, product pages. https://www.google.co.uk/search?q=site:arropa.co.uk/store&espv=2&biw=1536&bih=772&ei=LE5xVd3qA4HlUNnggKgH&start=250&sa=N One would assume that a page listed with the title of Ladies 1 Pair Young Trasparenze Mumbai Animal Print . and the description of Come on, program a little of your crazy side! Part of the edgy, sassy Young Trasparenze Medley, these soft touch, nontransparent stockings function a crazy, (along with the price) would be an entry for that individual product. However, clicking on that product opens up a search results page (very slowly as the site is processing an update still - it is not for public use thus far) which can be seen here http://arropa.co.uk/store/catalogsearch/result/?q=+ladies+1+pair+young+trasparenze+mumbai+animal+print+tights+75+off+military+l+ yes, the search result page is for that particular item but nowhere on the page is the title, description and price, nor has it ever been. Am a little puzzled about this and what it would do re duplicate content as im using the manufacturer data at present. Ideally i would like to keep the search results pages open. Any thoughts would be most welcome. Couple of things to note. Im aware the site is too slow for general public use. It will be fully cached once running, as i say, it has 300k+ products so isn't small. Also, am aware that there are no images. They exist but we are moving the images around, hence being down. Always a fun task when there are 25gb of the things!! Many thanks Carl
On-Page Optimization | | WonkyDog0 -
Duplicate Content aka 301 redirect from .com to .com/index.html
Moz reports are telling me that I have duplicate content on the home page because .com and .com/index.html are being seen as two pages. I have implemented 301 redirect using various codes I found online, but nothing seems to work. Currently I'm using this code. RewriteEngine On
On-Page Optimization | | omakad
RewriteBase /
RewriteCond %{HTTP_HOST} ^jacksonvilleacservice.com
RewriteRule ^index.html$ http://www.jacksonvilleacservice.com/ [L,R=301] Nothing is changing. What am I doing wrong? I have given it several weeks but report stays the same. Also according to webmasters tools they can't see this as duplicate content. What am I doing wrong?0 -
Help, a certain directory is not being indexed
Before I start, dont expect this to be too easy. This really has me puzzled and am surprised I am still yet to find a solution for it. Get ready. We have a wordpress website, launched over 6 months ago and have never had an issue getting content such as pages and post pages and categories indexed. However, I some what recently (about 2 months ago) installed a directory plugin (Business Directory Plugin) which lists businesses via unique urls that are accesible from a sub folder. Its these business listings that I absolutely cannot get indexed. The index page to the directory which links to the business pages is indexed, however for some reason google is not indexing all the listing pages which are linked to from this page. Its not an issue of the content being uncrawlable or at least dont think so as when I run crawlers on my site such as xml sitemap crawlers it finds all the pages including the directory pages so I am sure its not an issue of the search engines not finding the content. I have created xml sitemaps and uploaded to webmaster tools, tools recongises that there are many pages in the xml sitemap but google continues to only index a small percentage (everything but my business listings). The directory has been there for about 8 weeks now so I know there is a issue as it should of been indexed by now. See our main website at www.smashrepairbid.com.au and the business directory index page at www.smashrepairbid.com.au/our-shops/ To throw in a curve ball, in looking into this issue and setting up tools we noticed a lot of 404 error pages (nearly 4,000). We were very confused where these were coming from as they were only being generated from search engines - humans could not access the 404s and so we are guessing se's were firing some javascript code to generate them or something else weird. We could see the 404s in the logs so we know they were legit but again feel it was only search engines, this was validated when we added some rules to robots.txt and we saw the errors in the logs stop. We put the rules in robots txt file to try and stop google from indexing the 404 pages as we could not find anyway to fix the site / code (no idea what is causing them). If you do a site search in google you will see all the pages that are omitted in the results. Since adding the rules to robots, our impressions shown through tools have jumped right up (increased by 5 times) so thought this was a good indication of improvement but still not getting the results we want. Does anyone have any clue whats going on or why google and other se's are not indexing this content? Any help would be greatly appreciated and if you need any other information to assist just ask me. Really appreciate anyone who can spare their time to help me, I sure do need it. Thanks.
On-Page Optimization | | ziller0 -
Is this good practise for SEO: www.example.com/testing-once/testing-once.aspx?
My web developer is telling me that it is best practice for SEO to place your keyword in your URL twice. For Example: www.example.com/testing-once/testing-once.aspx. I'm sure that this is not true, could you please help?
On-Page Optimization | | CoGri0 -
Massive 301 Permanant Redirects
Hello, First thing first, I am not moving my website to new domain neither changing my hosting. I just want to change internal page URLs to make them user and search engine friendly, URLs of categories and URLs of category filers. What I am talking about is massive 301 redirection. There are some pages which have backlinks and I have no doubt about using 301-permanant redirection for those pages. But as far as the category filter pages are concerned there are no backlinks for those pages, but yes they do have some authority. My website is 2months old. Now I want to know that Does massive redirection effects the website authority? Or avoid using permanent redirection for all pages instead use only for those pages which have back-links and avoid using for category filter pages. http://www.artorca.com/
On-Page Optimization | | MozAddict0 -
Google indexing https insted of http pages
Hi!
On-Page Optimization | | ovieira
First of all i have a Wordpress portuguese languagem website (**http://**bit.ly/TGjpVx). For a while, for security pourposes, i had a SSL certificate installed on my website but i didn't renew it, for a few months now. I didn't have any special https page. All pages responded using http or https. My problem is that it seems that Google still indexes some o my webpages with https and not http, so when people click on it they get a bad cached page. No good for SEO, i think. What can i do about this? I only want Google, and other serach engines, to index my clean http pages (about 70 pages). Thanks,
OV0 -
Quick Question on Redirects
This might be a silly question, but one important enough for me to ensure that I understand the best practice of URL redirects... I'm thinking of changing my URL's and hierachy of some of my WP subpages around, in order to logically fit the keyword into the url and place the subpage closer to the root domain. My question is, when doing this, can I simply edit the URL and create a redirect after the fact, essentially killing the old URL. Or, do I create the new page with the updated URL and hierarchy, keeping the old page live and intact, but have that 301 redirect to its new corresponding destination? Thanks
On-Page Optimization | | JayAdams320