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
-
Page Analysis - Helping Product Pages Outrank Search Results Pages
Hi! We have a lot of our search results pages that have been indexed and outrank our product pages and in some instance the actual product pages barely show up at all. Here is an example query that includes our brand name: http://goo.gl/cgB6W So, we have loads of actual product pages, video pages, etc that should be showing up here, but are not and this is just one example. Unfortunately, there are a LOT of these Search Results pages out there and utlimately we would love to de-index them altogether, but it's going to have to be carefully done. So, was wondering if anyone would want to check out one of our product pages and give any feedback as to what we could change to possibly improve rank or to make them more search friendly or hopefully to help them rise above these indexed search results pages? Here is an example product page: http://goo.gl/2R4IT Thanks!! Craig
On-Page Optimization | | TheCraig0 -
Pages indexed but not seen in wordpress
Hi there, the crawler of SEOMOZ has detected that some pages have no title or a short metadescription. The problem is that I can't see these pages in wordpress (in the backend). These pages are irrelevant and must be deleted but I can't find them. How could they be indexed by the Googlebot? Where can I find them? Any hint? Thanks all.
On-Page Optimization | | juanmiguelcr0 -
How much SEO value does a fashion site get from bolting text onto the bottom of home page? Does the value compensate for cluttering up a page focused on an iconic image?
Getting ready to launch a completely redesigned site for a fashion designer. Since it is a fashion site, visitors do not need text to describe what the site is about., We are weighing three options: 1) clean design with no text (just images and navigational links), 2) bolting on a couple of sentences of text at the bottom of the page to signal keyword terms to the search engines, 3) following the lead of the top ranking site in the category and adding lots of text to the bottom of the page. Do the SEO benefits justify cluttering up the design by bolting text onto the bottom of the home page, and if so, how many characters of text seem to be the minimum to be effective?
On-Page Optimization | | RandyP0 -
Dynamic pages on a static html pages websiite
Good evening everybody. I am new on SeoMoz that I find very helpful in my work. I am not a web developer so please excuse me if my technical language is poor.I have an issue that maybe you can help me to solve. I work for a company who has a website, which is old and very well positioned on google for the most important keywords for the field of the company I work for (dentistry). It is a website made some years ago and it's made of static html pages.I would like to add a section in my website where I can post articles, like a blog (I think of a wordpress-style website) with daily posts (so with a dynamic page). Is there a way to do this without modifying the structure of the website and without losing pages, urls and ranking? We're on the first google page for many keywords of interests in our city and it would be a great damage for us to lose those positions.Thank you very much!
On-Page Optimization | | adec0 -
Two points of view on optimizing our search pages. What should we go with?
So we're in the process of going back and forth with our designer about optimizing our search results, which also doubles as a landing page for visitors searching with keywords like "Meeting Rooms Seattle" and "Seattle Meeting Spaces" We're on the front page in the SERPs, but still have a way to go. This is our current page: http://www.evenues.com/Meeting-Spaces/Seattle/Washington And this is something we've proposed for our designer to work with: http://imgur.com/JU1zg There search page text and links in the top left corner were to be placed for onsite SEO purposes ie we have no real text/content on the page for relevancy. We're currently in the process of writing the copy for each city on the search pages. Our designer made this argument: After giving it some thought I came to the conclusion that we may want to take a step back, and focus on the overall goal of this exercise. From what I have gathered, you would like to generate more click-throus and improve SEO, right? In my opinion, adding all of the provided copy and the link farm to the search results page would not necessarily help that. In fact, I think it would actually push the actual results way down. The content you provided me is more suited for a landing page, not a search results page (that is taking into consideration that you want similar content for other locations). Redfin has done a ton of great SEO work on their site. Using them as an example, if you go to Redfin.com, you will find tiny links in the footer that say "home for sale in seattle" etc. If you click on those, it puts you on a page like this: http://www.redfin.com/cities/1/seattle?src=homepage and then from there you can click to a neighborhood page like this: http://www.redfin.com/city/1387/WA/Bellevue. I would recommend that we create a set of location pages with the content the client is asking for, that are specifically optimized for SEO, and provide links in the footer of the site to get to those pages. Then the links on the new landing pages would land the user on the search results page. By keeping two different pages for two different purposes separate would help keep content more organized and help user find specific info they are looking for. As a quick fix we could put one line of text under the H1 text on search results as well, maybe with a strong tag. By doing that we will be able to keep the page looking clean and easy to navigate through. Anyways, that's just my two cents. Any ideas/input on this?
On-Page Optimization | | eVenuesSEO0 -
If I have too many on-page links can I reduce it with nofollow tags or do the links have to be removed?
On my site I have a top nav drop down menu but once visitors go to one particularly large subsection, that menu is repeated on the left for easier viewing. As a result, I shoot over 100 links on page. Can I put nofollow or noindex tags on the left side links and reduce my "official" on-page links count or do I have to actually eliminate some of the links? Thanks, Oak
On-Page Optimization | | CSA-2316710 -
Max # of recommended links per page?
I've heard it said that Google may choose to stop following links after the first 100 on a page. The landing/category pages for my site's product catalog have earned quite a respectable PR and positioning in search results, and I'm currently paginating their product listings (about 200 products in a category) so that only a couple dozen products are shown on the first page, with links to "next page" and "previous page" being accomplished via query string (i.e. "?page=3"). An alternative option I have is to link to 100% of the contained products within the category's landing page (which would increase my on-page link count to ~300) and use CSS/Javascript to allow the user to simulate browsing between pages on the client side. My goal is to see as many of my product pages indexed as possible. Is this done better using my current scheme (where Googlebot would have to navigate to, say, Landing Page -> Page 6 -> Deeply Buried Product Page) or in the alternative method above, where all the links are in a single page? Since my landing pages are currently treated pretty well by search engines, would that "trust" cause them to follow more links than might normally be done? Thank you!
On-Page Optimization | | cadenzajon0 -
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