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
-
Too much internal linking?
Hi everyone, Too much of anything is not good. In terms of internal linking, how many are too many? I read that the recommended internal links are about 100 links per page otherwise it dilutes the page's link equity. I have a concern about one of our websites - according to search console, the homepage has 923 internal links. All the pages have a corresponding /feed page added to the page URL, which is really weird (is this caused by a plugin?). The site also has an e-com feature, but it is not used as the site is essentially a brochure and customers are encouraged to visit the shop. I assume the e-com feature also increases this number. On the other hand, one of the competitors we are tracking has 1 internal link site-wide. Ours is at 45,000 site-wide. How is it possible to only have 1 internal link? Is this a Moz bug? I know we also need to reduce our internal links badly, however, I'm not sure where to start. I don't know how these internal links are linked together - some aren't in the copy or navigation menu. When I scan the homepage links using 'check my links', the total links identified for the homepage is only 170. kAeYlTM
On-Page Optimization | | nhhernandez0 -
Simple question: I wonder if I'm over internally linking?
Hi, What's you guys' policy on how much to internally link. I do it a lot - whenever it makes sense, but hold off if I just linked to the same page in the last paragraph, for instance. Would like to know your thoughts to see if I'm overdoing it. This is for Ecommerce blog posts, category descriptions, and product descriptions if that matters. Thanks.
On-Page Optimization | | BobGW0 -
Is Google indexing something I can't see on my page title?
When I do a search for my businesses website (colourpages.com) it returns a listing which is great but the title tag includes Hull Colour Pages which is our old brand name - we changed to colourpages.com 2 years ago yet Hull Colour Pages is still pulling through on the title tag. I have checked the source and it's as follows: <title>Plumbers in Hull - Reviews - colourpages.com</title> I have attached a photo which shows the issue - http://imgur.com/Cva3001 Is Google indexing it from old history that is no longer visible or am I missing something? Cva3001
On-Page Optimization | | colourpages0 -
Duplicate Home Page
Hi, I have a question around best practise on duplicate home pages. The /index.aspx page is showing up as a top referrer in my analytics. I have the rel=canonical tag implemented for the www.mysite.com on both pages. Do I need to 301 the /index.aspx to the mysite.com? I have a lot of links pointing to the /index.aspx (half of those are coming from the mysite.com). www.mysite.com/index.aspx www.mysite.com Many thanks Jon
On-Page Optimization | | JonRaubenheimer0 -
Too Many On-Page Links
Hello. So, my SEO team has worked very hard to finally resolve RogerBot/GoogleBot specific Crawl Errors either manually or programmatically can be fixed for our Budget Blinds USA Pro Campaign. We've done a good job even if a lot of it came from Robots.txt file entries as this was the most efficient way our client chose to do it. Good news is most of it is CMS configuration and not bad site architecture. That being said our next big volume of Crawl Errors is "Too Many On-Page Links". Our Moz DomainRank is 61. Our client, on this new version of the website, added a large nav-based footer which has duplicate links from the Header Main Navigation. I believe our solution is to put in No-Follow Metatags at the Footer Link Level, so we don't zap Page Authority by over-dividing as you recommend. Is this the best way to resolve this? Is there any risk in this? Or is a 61 DomainRank high enough for RogerBot and GoogleBot to crawl these anyway? Please advise,
On-Page Optimization | | Aviatech0 -
Too Many On-Page Links error
Hello, I am new to this. The crawl of y website reveals that "Too Many On-Page Links" were found on many pages of the website. However, when I check those pages, not more than 5 links are found- I have not included links outside of the post (sidebar/comments/related posts - are these counted in the crawl report ?). I do use SEO SmartLinks Plugin where in some keywords point to Wordpress Categories but am not sure whether that could be the problem at all. Can someone guide what the issue could be and how to debug ?
On-Page Optimization | | sradhey0 -
The Value of Internal Links?
I have seen countless SEO "experts" suggest internal links are great to help the search engines find your content. I wonder if that is true any more. It seems like a sitemap would do a better job. I think tags may even hurt the content I want to Google to know as most important. I'm using Simple Tags on all of my WP sites. If it "sees" a word in the article that is also a tag it adds a link for that tag to a listing of all the articles with that tag. It only does this once per tag though. Going on the experts advice, I thought this was a good idea. But now, I'm thinking these tags reduce the value of links to my eBook or other content i want to feature. Which doesn't get tagged much since I don't promote it all that often on my site within content. I make it nearly impossible to miss it on the site though. 🙂 What I do see the tags doing is helping users find the content. So I do see it improving the bounce rate and giving uses an assist in finding more content about what they are looking for. I have tags marked as noindex follow. But I'm really considering now removing the links. I hate plugins anyway. 🙂 Seems I'm always finding another must have plugin though. Now I'm thinking I'd be better off to just add links manually into the content that I really want to feature. All these automatic links I'm generating can't be good. Thanks for your thoughts on this.
On-Page Optimization | | RustyF0 -
Linking Back to the Same Page
What are the other seo's opinions on linking the same keyword you are targeting lets take an example like Trampolines. So we have a Online shop selling trampolines would you feel it a good or bad thing to link the keyword trampolines from the homepage to the homepage almost creating a loop. Some SEO's say yes some say no ?
On-Page Optimization | | onlinemediadirect0