Is it ok to point internal links to index.html home page rather than full www
-
I thought I saw this somewhere on SEOmoz before but I was so busy by the time I got around to work on my SEO on my site, I realized I have this happening and can't recall if it is a problem which takes away from my ranking.
If my www.website.com is ranking well but I have internal menu links pointing to www.website.com/index.html instead of www.website.com will that take away from my www.website.com rankings?
Should I change all my menu links that point to /index.html to the full website url path www.website.com ?
-
Awesome! By adding the following code to my .htaccess file, and placing it in my public directory it works. Didn't work from the root directory which I figured out later. I think related concerns are solved now. Now to see how the results show on the next crawl.
RewriteCond %{REQUEST_URI} /index.html?$ [NC]
RewriteRule ^(.*)index.html?$ "/$1" [NC,R=301,NE,L] -
Try this - of course take what you need from it - source is here - http://stackoverflow.com/questions/6059920/removing-index-html-from-url-and-adding-www-with-one-single-301-redirect Options +FollowSymlinks -MultiViews RewriteEngine on RewriteCond %{HTTP_HOST} !^www. [NC] RewriteCond %{REQUEST_URI} ^(./)index.html$ [NC] RewriteRule . http://www.%{HTTP_HOST}%1 [R=301,NE,L] RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule . http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,R=301,L] RewriteCond %{REQUEST_URI} ^(./)index.html$ [NC] RewriteRule . %1 [R=301,NE,L]
-
Thanks. I was trying a mobile version of the website also at some point. I will just delete that one for now.
I can try your idea but is forwarding from the page itself still good for SEO?
-
Well, I tried taking out the 2nd instance of RewriteEngine on but i Just get a 500 error now. I put it back how it was for now.
Any other ideas?
-
could it not be working because you used rewriteengine twice?
-
The 301-redirect that Mark and Nakul discuss is probably your best bet here, but if that's causing you implementation problems, you could use the canonical tag on your home-page (in the section):
That will help sweep up any duplicates. It is best to link consistently to the root version, though (without the "index.htm"). FYI, you've got another weird duplicate in Google's index:
-
Thanks. Sorry I meant to say index.htm. Thanks you both for making this very clear. I've already created a .htaccess file to fix my twin domain issue, now I just have to modify the .htaccess file to include this code.
The code unfortunately doesn't seem to work when I upload it. meaning, when I type in my website address including index.htm the display still says index.htm rather than removing that part. Am I doing something wrong? Here's what I have currently in my htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www|blog|askdaniel).
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]RewriteEngine on RewriteCond %{THE_REQUEST} ^./index.htm?\ HTTP/ RewriteRule ^(.)index.htm?$ "/$1" [R=301,L]
-
Hi Daniel,
I was a bit confused by this - index.html on your site returns a 404 error. I changed the url to index.htm and then it returns the correct information as a 200.
Basically, I'm not saying to delete the page index.htm - that is in fact your default page and what the server will show as your homepage. Nakul and I have just been saying to configure the server to strip out the index.htm from the URL and just show twinbytes.ca. Since your site is in fact on an Apache server, you should be able to use the htaccess info that Nakul gave you. But be careful when changing an htaccess file - you can really mess up your site if you don't do it properly. Be sure to make a backup of the file before making any changes or additions to it.
Even though your file is index.htm, the line in Nakul's code should have you covered due to the regular expression.
Mark
-
Thanks. You answered my main question. One other question then from that. How can I remove the index.html file from the website but still have the main website load? I believe the index.html file has to be located somewhere for the main page to know where to look. Right? I believe if you go to www.twinbytes.ca which is my website, it really looks at www.twinbytes.ca/index.html anyway to get the information to display. Would I be correct in saying so? I understand 90% of this, but this whole index.html for the home page thing is a bit confusing.
-
Yes, that's right. Thanks Mark for specifying that .htaccess will only work if you are Apache based.
-
Nakul didn't specify, but the code he gave you is if your site is running on an apache server. Make sure to work with your developers to deal with these issues, and don't try changing your htaccess file on your own - you make major problems for your site very easily.
-
Ideally, it's best not to have the index.html showing up as well - could be a problem of duplicate content. So I would recommend correcting your internal links to point to www.website.com without the index.html. Generally, you should set up the server so that it strips out the index.html and 301 redirects to the clean domain. However, if you need to keep the index.html live and can't redirect it, at the very least I'd make sure to use a canonical tag on the page pointing to the clean version of the page, www.website.com.
Let me know if you need me to elaborate further.
Mark
-
Yes, you definitely should and when you do that, make sure you do a redirect from www.website.com/index.html to www.website.com You could do that via .htaccess RewriteEngine on RewriteCond %{THE_REQUEST} ^./index.html?\ HTTP/ RewriteRule ^(.)index.html?$ "/$1" [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
-
Single Page on my client's website is not crawling and indexing new changes. What could be the possible reason?
I made several changes on client's website on different pages, changed titles, add content on few pages, moved blog from subdomain to sub directory. Everything is crawled but there is one page on the website (not part of the blog) that isn't getting crawled in Google and picking up changes. The last crawl of the website is 2 days back whereas that page was last crawled on 30th sep. I just wanted to know the possible reasons and has anyone encountered this before?
On-Page Optimization | | MoosaHemani0 -
Why are my pages de-indexed?
<form id="form-t3_37nfib9dz" class="usertext" action="http://www.reddit.com/r/SEO/comments/37nfib/why_were_my_pages_deindexed/#"> Hello all, I am very new to SEO. For some reason many of the pages on my site were de-indexed. Specifically the ones linked from this page: However other pages, like the ones linked from this page and this page were not de-indexed. http://www.lawyerconnection.ca/practice-areas/car-accident-injury-lawyers/[1] However the pages linked from this page were not de-indexed: http://www.lawyerconnection.ca/practice-areas/slip-and-fall-lawyers/[2] http://www.lawyerconnection.ca/podcastresources/[3] That first page itself was not de-indexed, just the site that it links to. It just happened today, so maybe I am jumping the gun but I doubt it. When I enter the page into google webmaster tools again and press fetch, one of the child pages, it re-indexes. What could be the problem here? I had someone re-write the content for every city but I have a feeling that there is less differences in the car accidents pages? Is this considered duplicated content do you think? Am I making some other mistake I can't think of? Is it just a one day blip (I doubt it) Let me know, thanks. </form>
On-Page Optimization | | RafeTLouis0 -
On page links
Hi I am really intrigued by Bloomberg strategy. if you look at their article pages they are full with internal links done with what I assume to be an automated process (too many pages to be done manually). it seems to work for them. I would love to hear your opinions.
On-Page Optimization | | ciznerguy
http://www.bloomberg.com/news/2014-11-26/uber-said-close-to-raising-funding-at-up-to-40b-value.html0 -
Links to Paywall from Content Pages
Hi, My site is funded by subscriptions. We offer lengthy excerpts, and then direct people to a single paywall page, something like domain.com/subscribe/ This means that most pages on the site links to /subscribe, including all of the high value pages that bring people in from Google. This is a page with an understandably high bounce rate, as most users are not interested in paying for content on the web. My question is are we being penalized in Google for having so many internal links to a page with a very high bounce rate? If anyone has worked with paywall sites before and knows the best practices for this, I'd be really grateful to learn more.
On-Page Optimization | | enotes0 -
Question Re Cornerestone Page And Anchor Text For Internal/External Links
Suppose I create a cornerstone page with the targeted keyword "Dog Collars". I write a dozen articles on various dog collars and point a link from each article to my cornerstone page. Should the anchor text for the links from each of those articles to the cornerstone page be "Dog Collars" or should they vary, but still be relevant to "Dog Collars" for best SEO? Should half of them be "Dog Collars" and the other half various? Also, if I have 12 articles and all of the anchor text is already "Dog Collars", should I go back and change them so that they all don't say the same thing? If hope my question makes sense ... thanks in advance. I will give thumbs up for helpful responses and suggestions 😉
On-Page Optimization | | Humanovation0 -
Index.php getting Duplicate page content.
I am quite new to SEO and have now got my first results. I am getting all my index.php pages returned as Duplicate page content. ie: blue-widgets/index.php
On-Page Optimization | | ivoryred
blue-widgets/ green-widgets/large/index.php
green-widgets/large/ How do solve this issue?0 -
Webpage with around 200+ inter links per page
HI, I have a client that I recently took on and I run a SEOmoz crawl on the website and a minor error was that .. 1. web pages have more than 200+ interlinks, reason for this is becuase the client offers a service to every place in the world and then has links to contact us/about us etc those kind of pages. is this something we need to strongly avoid? 2. The title tags are all over the suggested amount by 1/2 letters. - again is this really bad?
On-Page Optimization | | Prestige-SEO0 -
Home Page Keyword Retargeting
Hi Guys! I have a question regarding the risk of **re-targeting **your homepage to another **keyword. ** To give a little background: I am working on a clients site that targets a keyword we initially thought during the keyword research phase, would be an appropriate target. What we found out is that it is not. Everything in analytics points to this keyword not performing well. We now want to re target the homepage to another keyword target. My questions are: How risky is it to do this given we have already done a fair amount of link building to the home page with anchor text from the initial keyword target? Will this look suspicious to google? What sort of things should we consider before moving forward with this change?
On-Page Optimization | | gravityseo0