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
-
Will adding 1M (legitimate/correct) internal backlinks to an orphan page trip algo penalty?
We have a massive long tail user generated gamification strategy that has worked really well. Because of that success we haven't really been paying enough attention to SEO and in looking around caught some glaring issues. The section of our site that works as long tail goes from overview page > first classification > sub classification > specific long tail term page. Looks like we were relying on google to crawl/use forms to go from our overview page to the first classification BUT those resulting pages were orphaned - so www.mysite.com/product/category_1 defaulted back to the search page creating duplicate issues. www.mysite.com/product/category_1 and www.mysite.com/product/category_2 and www.mysite.com/product/category_3 all had duplicate content as they all reverted to the overview page. It's clear we need to make an actual breadcrumb trail and proper site taxonomy/linkage. I'm wanting to do this on just this one area first, but it's a big section with over 3M indexed "specific long tail term pages". I want to just add a simple breadcurmb trail in a sub navigation menu but doing so will literally create millions of new internal backlinks from specific term pages to their sub & parent category pages. Although we're missing the intermediary category breadcrumbs, we did have a breadcrumb coming back to the main overview page - that was tagged nofollow. So now I'm contemplating adding millions of (proper) backlinks and removing a nofollow tag from another million internal back links. All of this seems in line with "best practices" but what I have not been able to determine is if there is a proper/better way to roll these changes out so as to not trigger an algorithm penalty. I am also reticent about making too many changes too quickly but these are SEO 101 basics that need to be rectified. Is it a mistake to make good improvements too quickly? Thanks!
On-Page Optimization | | DrewProZ1 -
The links pointed to a multilanguage site, should increase the DA? (Wordpress question inside)
We are planning to make our site available to several language, using the plugin WPML in Wordpress. The site should look with /es/, /fr, etc. If someone point to an URL in the spanish version, the english version get any benefit from it? (better search ranking or something like that). Some side question: WPML works fine with SEO and Moz?
On-Page Optimization | | carlostinca0 -
Is there a limit to the number of duplicate pages pointing to a rel='canonical ' primary?
We have a situation on twiends where a number of our 'dead' user pages have generated links for us over the years. Our options are to 404 them, 301 them to the home page, or just serve back the home page with a canonical tag. We've been 404'ing them for years, but i understand that we lose all the link juice from doing this. Correct me if I'm wrong? Our next plan would be to 301 them to the home page. Probably the best solution but our concern is if a user page is only temporarily down (under review, etc) it could be permanently removed from the index, or at least cached for a very long time. A final plan is to just serve back the home page on the old URL, with a canonical tag pointing to the home page URL. This is quick, retains most of the link juice, and allows the URL to become active again in future. The problem is that there could be 100,000's of these. Q1) Is it a problem to have 100,000 URLs pointing to a primary with a rel=canonical tag? (Problem for Google?) Q2) How long does it take a canonical duplicate page to become unique in the index again if the tag is removed? Will google recrawl it and add it back into the index? Do we need to use WMT to speed this process up? Thanks
On-Page Optimization | | dsumter0 -
Impact of number of outgoing links on Page Rank of an optimized page?
What is the current best practice on preferred number of outbound links on a page you are trying to rank with: According to online resources form a pure page rank perspective a high number of outbound follow links can have a negative impact not only on child pages but also the page itself
On-Page Optimization | | thomaspro
http://pr.efactory.de/e-outbound-links.shtml Other resources suggest that particularly placing high quality outbound links on a page (nofollow) increases the trust and authority of a page Are there any other elements to keep in mind? Is the best practice to avoid any follow links on a page you want to rank well in Google for? Thanks /T0 -
Title Tags for Index Pages
What tactics do you use to change the title tags of your index page so they're not all the same? For example, if you have an index page that has 100 pages, each with the same title, what tactics do you use to give each page a unique title and how important is it?
On-Page Optimization | | felt0 -
The "100 links/page recommendation" - Do Duplicate Links Count?
We have way too many links on our homepage. The PageRank Link Juice Calculator (www.ecreativeim.com/pagerank-link-juice-calculator.php) counts them to 300. But all of them are not unique, that is some links point to the same URL. So my question: does the "100 links/page recommendation" refer to all anchors on the page or only to unique link target URLs? I know "100" is just a standard recommendation.
On-Page Optimization | | TalkInThePark0 -
Page Indexing
Hello All Nice easy question! I've made some on page changes to page titles, content, H1s etc but wanted to know if there was a way to check if Google has reindexed the page since the changes were made? I appreciate the different factors that will help improve your crawl rate like new content, external links, domain authority etc. I made these changes around 2 weeks ago. Google has cached the pages since I made the changes but not picked up on the new page titles in the search results. Cheers Todd
On-Page Optimization | | todd75850 -
Eliminating outbound links for long tail-targeting pages
I have a number of pages that rank on the 1st page for highly long tail phrases, despite the pages having outbound links to things like 'privacy policy' 'terms of use', make a payment, etc...all pages that can be accessed from the home page. Do you recommend I eliminate these administrative pages from the long tail-targeting pages, to reduce outbound page rank flow? Does anyone create a different breadcrumb navigation or remove one altogether for pages that are highly targeted to improve their rank?
On-Page Optimization | | ilyaelbert0