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
-
Duplicate home page URL on crawl test
Hi i just recently made a crawl test but before doing that i made sure that i have no more duplicates on my site i am using joomla and as of now i only have 11 links on my site but when my crawl test is done i saw duplicate url of my homepage the duplicate url has a trailing backslash so basically i have all the 11 links + 1 duplicate URL http://mangthomas.com http://mangthomas.com/ can you guys give advise how i can remove the duplicate i dont even know which one to retain. THANKS A LOT, cris
On-Page Optimization | | crisbasma0 -
Should I link G+ and social accounts to internal pages?
Hi Gang, We are a multi-state law firm (Indiana, Michigan, New Mexico) that is looking to increase ranking for Michigan and New Mexico for 2015. (Michigan and New Mexico used to exist as subdomains under 2keller.com but have now been incorporated as pages under the main domain.) The question is whether or not we link directly to what we call the "main state pages" from various accounts like G+, FB, Yellow Pages, Yelp, etc.? For example, should we link from our New Mexcio G+ page to our New Mexico main page, or should it be linked to the main domain at 2keller.com where our general branding is on display? I seem to remember somewhere seeing a Whiteboard Friday or some other forum in which Rand had spoke to something similar. I believe he advised AGAINST trying to control the "user experience" for instances like these, but I can't locate same. I understand that clients/customers are looking for our main brand, but it would seem to be the better experience to get users in state specific locales to their state specific page. Am I thinking wrong about this? Thanks in advance! Wayne
On-Page Optimization | | Wayne760 -
Why Google did not index exactly these 2 pages? Any ideas?
Dear Community, on 27th of July I relaunched my own website and submitted the sitemap as well I send the index-page to crawl it including all linked pages. Already the next day the new pages have been indexed. Today I checked them manually if they have been indexed. The result is that 2 of 13 pages have not been indexed, here marked in bold: http://inlinear.com/
On-Page Optimization | | inlinear
http://inlinear.com/suchmaschinenoptimierung-online-marketing.php
http://inlinear.com/design/
http://inlinear.com/design/printmedien-gestaltung.php
http://inlinear.com/design/corporate-design-und-corporate-identity.php
http://inlinear.com/design/corporate-raum-design.php
http://inlinear.com/webentwicklung/
http://inlinear.com/virtueller-rundgang-360grad-fotografie.php
http://inlinear.com/business-atlas-online-verzeichnis.php
http://inlinear.com/baudokumentation-bauueberwachung.php
http://inlinear.com/ueber-uns.php
http://inlinear.com/blog/
http://inlinear.com/kontakt/ The page "/design/" (which is the index.php of this folder should be the main-page because its about WEB DESIGN.
Should I create a copy and call it /design/web-design.php? May be Google prefers a meaningful URL than the index.php? So I put then a rel=canonical to web-design.php in my index.php? design/corporate-design-und-corporate-identity.php
The URL is a little long, but this should not be the reason? Or might be a reason that another page which is still in the index, but not online anymore (even redirecting to /design/) is still more dominant? Strange.... orshould I simply wait a little or try submitting these to sites manually to google? When checking Google Webmasters Tools Google tells me that just 3 pages have been indexed.
When I was checking which page is indexed or not I checked each URL with the site-search option:
site:inlinear.com/pageX.php ... when Google shows this page, it was a sign that it was indexed but why webmasters tools show up only 3 pages? (see screenshot) Do you have any ideas?
Thank You 🙂 indexed.png0 -
Html code for none .index
In the diagnostic I have several errors in Duplicate Page Content and Title. The thing is that the errors is on the same page but with "different" names. One is called http://siteX.com/ another is called http://www.siteX.com/ and the same third one is called
On-Page Optimization | | mato
http://www.siteX.com/index.html How do I go about changing all three sites, I have changed the /index.html one but dont know how to catch the other once. Is it possible, if it is I would like to know how?0 -
Excessive Internal Links & links to same location
Hi, When Google is counting internal links on a page and it comes across two links to the same url, do both of the links count towards Excessive Internal Links? The reason I ask is that on our website we allow users to navigate through the website in different ways (either by dropdown menus or side menu or through breadcrumbs); which cause some links to appear multiple times on the same page. Any thoughts? K.
On-Page Optimization | | soltec0 -
Internal linking
Background; selling childrens clothing (for norwegian market). main page is being optimized barneklær (children clothing) which is most used term. We ve been online for around 3 months and have gone from unranked to 25th spot on google for this term. We are selling clothes from 8 different producers which all have their own 'page' - were all their products are listed. e.g http://www.epleskrinet.no/dundelina/M_13 . This page i am optimizing for the producer which is dundelina. For this term i show up in spot 24, 25 and 44. My problem is that its not the producer page that show up but the 3 most popular products. The producer page isnt ranked at all. What ive done so far is to have to producer link to my page from their site and blog (a week ago) - they were linking to my home page earlier. Ive put anchor text dundelina --> takes me to producer page on 4 out of 7 products. This was also done about a week ago. I am planning a blog about dundelina pointing to the right URL. From our blog I am using. Ive posted a couple of pictures on facebook pointing to right URL. Do i just need to be patient for this to be picked up or is there anything else i should do ? Thanks ... Dan Lærum
On-Page Optimization | | danlae0 -
Tags to index or to no index that is the Question
Sorry for the silly Shakespearean introduction but what are peoples opinions on leaving tag clouds to be indexed or no indexable by the search engines. I tend to leave them non indexable at the moment. I use wordpress for blogging as do most others.
On-Page Optimization | | onlinemediadirect0 -
Too many On-Page Links on a WP based Website
Hi, I've already browsed through various of the Q&As on the "too many On-Page links" issue, but I would really need some advice concerning a WP Site with a dropdown navigation. As outlined in the on-page report, every site has about 180 outgoing links, which pretty much is the number of site featured in the navigation. Even though the 100 link limit is somewhat outdated I'm still worried about the distribution of linkjuice from the starting page and how Google perceives the importance of the various pages. Would it make sense to adapt the structure of the navigation, so that the starting page only links to the 5 category pages and the category pages only link to the detail pages they contain? The site has good rankings for several pages and I assume that Google can tell that the large number of links is caused by the navigation. But with every page having appr. 180 links it may be difficult for Google to tell, which of those pages are the most important regarding internal link structure... Looking foward to your opinion and insights! Cheers, Chris
On-Page Optimization | | adwordize0