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
-
Which page will rank higher, my main article or the sub article linking from it?
Hi all, Can you help me figure this one out? I'm currently creating content for my website and I very badly want to know which page will rank higher in Google, my main article that has some keywords that are and links to my sub-article, or my sub-article which is optimized for those keywords? I will demonstrate with an example since I'm not sure my question is clear: If I have an article that talks about different kinds of candy and it links to a sub-article that will elaborate on specific candies like a mint candy ,which page will rank for mint candies. Until today I believed that if my sub-article which is linked from my main-article will rank for mint candies since it gets the support from my main article.Lately when experimenting this I found my thoughts to be wrong. Can anyone help me with this one?Any insights? Thanks, Leebi
On-Page Optimization | | Leebi0 -
Duplicate Page Content - default.html
I am showing a duplicate content error in moz. I have site.com and site.com/default.html How can I fix that? Should I use a canonical tag? If so, how would i do that?
On-Page Optimization | | bhsiao0 -
Two links to different page with same link label
What will be the impact in Google if I have two links in the same page pointing to different pages, but with the same label.
On-Page Optimization | | kjerstibakke0 -
Multiple menu items pointing to same page
I have an automotive dealer as a client. The primary nav has a finance menu item, which (of course) points to the finance related pages. He just requested that I add a finance link item, as child menu items, under the new and used car nav items. Now, this is wrong for a host of reasons, what is the best way to communicate to this to him? I mean, I see this as a usability issue, it's wrong thematically, we would end up having 3 links pointing to the same page. Would this classify as dupe content?
On-Page Optimization | | AfroSEO0 -
Question about multiple versions of home page
Hi guys, I'm having a question, answer to which i'm unable to find anywhere. I browesed the whole internet lol. So the question is about multipple versions of the home page. In particular, i want to know how should i deal with home page URLs with this extention: /index.html All the rest possible versions of home page i know how to deal with but this one "/index.html" i don't. I did add a cononical tag to it but i'm wondering whether or not i should add 301 redirect to chosen version og the home page (let's say it is www.mydomain.com). Please advise the best practices on how to deal with this. Thanks in advance!
On-Page Optimization | | odmsoft0 -
Does the title tag on the home page affect sub-pages?
Hello. I am thinking of changing our home page title tag to include our two most valuable keywords from two of our sub-pages. Would this help the rankings of those two sub-pages? Thank you!
On-Page Optimization | | nyc-seo0 -
On page link question, creating an additional 'county' layer between states and zips/cities
Question We have a large site that has a page for all 50 states. Each of these pages has unique content, but following the content has a MASSIVE amount of links for each zip AND city in that state. I am also in the process of creating unique content for each of these cities and zips HOWEVER, I was wondering would it make sense to create an additional 'county' layer between the states and the zips/cities. Would the additional 'depth' of the links bring down the overall rank of the long tail city and zip pages, or would the fact that the counties would knock the on page link count down from a thousand or so, to a management 50-100 substantially improve the overall quality and ranking of the site? To illustrate, currently I have State -> city and zip pages (1200+ links on each state page) what i want to do is do state -> county (5-300 counties on each state page) -> city + zip (maybe 50-100 links on each county page). What do you guys think? Am I incurring some kind of automatic penalty for having 1000+ links on a page?
On-Page Optimization | | ilyaelbert0 -
Internal Linking
I am trying to figure out internal linking. Please help me. Your "root domain" (the top level example.com) is the easiest to rank on a SERP. When you build Page Rank on this page, you want to make sure the majority of the PR goes into internal pages that matter. To do this you determine what internal pages are most important and put them on the menu bar. You then link to these pages in the body text, or via side bars. This will ensure that the PR is flowing from the root domain into the internal pages multiple times. The second part is to link from these secondary pages back to the main page. Correct? When you build back links on the internal page, you want to pass the PR back to the main page... Please discuss this...
On-Page Optimization | | JML11790