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
-
Bullet Points or Full Sentences
We are a furniture retailer and are currently looking at redesigning the website. Would it have an effect on SEO if the product descriptions were turned into bullet points and if the length of text on each page was shortened?
On-Page Optimization | | AHF_Furniture1 -
Number of internal links and passing 'link juice' down to key pages.
Howdy Moz friends. I've just been checking out this post on Moz from 2011 and wanted to know how relevant it is today? I'm particularly interested in a number of links we have on our HP potentially harming important landing page rankings because not enough 'link juice is getting to them i.e) are they are being diluted by all the many other links on the page? (deeper pages, faqs, etc etc) It seems strange to me that as Google as has got more sophisticated this would still be that relevant (thus the reason for posting). Anyway, I thought I was definitely worth asking. If we can leverage more out of our on-page efforts then great 🙂
On-Page Optimization | | isaac6630 -
Is it better to try and boost an old page that ranks on page #5 or create a better new page
Hello Everyone, We have been looking into our placements recently and see that one of our blog posts shows on page #5 for a popular keyword phrase with a lot of search volume. Lets say the keyword is "couples fitness ideas" We show on page 5 for a post /couples-fitness-ideas-19-tips-and-expert-advice/ We want to try and get on the first page for that phrase and wanted to know if it is better if we did one of the following: 1. Create a new page with over 100 ideas with a few more thousands of words. with a new url (thinking /couples-fitness-ideas) 2. Create a new page with a new url (thinking /couples-fitness-ideas) with the same content as the currently ranking post. We would want to do this for more freedom with layout and design of the page rather than our current blog post template. Add more content, let's say 100 more ideas. Then forward the old URL to the new one with a 301 redirect. 3. Add more content to the existing post without changing the layout and change the URL. Look forward to your thoughts
On-Page Optimization | | MobileCause0 -
Problem with internal links.
Hello,I am trying to do an audit of the internal links of my site at zenplugs.com. I am having great difficulty simply trying to establish how many internal links there are on the home page. Off the top of my head I think there are probably 20-25 but Screaming Frog tells me there are 574, the MozBar is listing zero and Open Site Explorer is telling me my site hasn't been indexed yet. I have tried several web based services but most of them don't work. Can anyone recommend a tool which has given them a number they trust? My second query is that one of the tools told me that there are 4 links on the home page with no anchor text, linking to http://zenplugs.com/#. Is this a problem? Many thanks, in advance. Toby
On-Page Optimization | | T0BY0 -
Content for the Home Page
Hi All, I have a Videos website which contains Videos of all types + Family safe type... The home page has sections and Videos listed. Now for SEO purpose i need to have content? this is what i read in most places. What is the kind of content i can place on a Videos website Home page? I can write about a Movie or actor but that content on Home page would that be of any use? We have a About us page etc to know who we are.. Any ideas please..
On-Page Optimization | | Nettv0 -
Is it ok to use the H1 tag for bullet points?
Our search results page doesn't have a typical H1 tag because adding a true header would take up space unnecessarily. Therefore, we've assigned the h1 tag to be the breadcrumb. As filters are applied, the breadcrumb grows to include these filters. This breadcrumb is coded as bullet points, even though they're not the typical style of bullet points. Here's a screenshot: http://screencast.com/t/AjGC9iAYR3 For example, the breadcrumb: Home >> NYC Social Media Classes >> Adult >> Manhattan is currently coded as: | |
On-Page Optimization | | mevseo
| | * class="first"><a <span="">href</a><a <span="">="</a>/">Home |
| | * <a <span="">href</a><a <span="">="</a>/nyc/classes/social-media/age-adults/neighborhood-manhattan" class="Selected">Search results |
| | |
| | |
| | id="cat_social-media" type="checkbox" checked onclick="setCategory('social-media')" /> |
| | # style="font-size: 12px; display: inline;">NYC Social Media Classes |
| | <label <span="">for</label>="cat_social-media"> |
| | |
| | |
| | |
| | <nobr>id="age_adults" type="checkbox" checked onclick="setAge('adults')" /><label <span="">for</label>="age_adults">Adults</nobr> |
| | |
| | |
| | <nobr>id="nbhd_manhattan" type="checkbox" checked onclick="setNeighborhood('manhattan')" /><label <span="">for</label>="nbhd_manhattan">Manhattan</nobr> |
| | |
| | | Right now that H1 tag just relates to 'NYC Social media classes', but we'd like to expand it to include both 'Manhattan' & 'Adults' - would that be ok? And if so, would it be better to put the tag before and after the tag?0 -
What is the best way to make use of internal anchor text links without appearing to be a 'spammy' webpage?
I've recently been spending some time going through all the content on our website, henstuff.com, adding internal anchor text links to product copy with the link following back to the product's generic catagory. I've been focusing on the search term 'hen party accessories', but have also been using 'hen do accessories' and 'hen night accessories'. I know that internal linking has value when it comes to SEO and rankings, but was keen to find roughly at what point usage of a certain search term for anchor links is seen as spam by the engines. Is there a certain formula to follow when it comes to internal anchor text links? You can see some examples at: http://www.henstuff.com/hen-night-accessories/hen-party-accessories/willy-bubbles http://www.henstuff.com/hen-night-accessories/hen-party-devil-horns/hen-night-pink-devil-horns Many thanks Oli
On-Page Optimization | | RobertHill1 -
Picking a Keyword to optimize for home page
Hi there, I have chosen a keyword for a bunch of my top pages based on relevance, traffic, competition etc, and am tracking in the Tool - so far so good. The issue I am having is with picking a keyword or phrase for the home page - all the suitable keywords I seem to have been allocated to 1 particular sub pages - basically product pages... Anyone come across this issue? Basically any keyword or phrase that I think might be suitable for the home page, I find a more precise page beneath the home page.... Help gratefully accepted!
On-Page Optimization | | inhouseninja0