Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
301 Redirect index.html to root
Old 07-22-2010, 05:31 PM 301 Redirect index.html to root
Junior Talker

Posts: 4
Name: Finne Jager
Trades: 0
For some reason, Google Webmaster Tools shows that I have crawl errors because of other sites linking to www.ciagent.com/index.html, but that file doesn't exist. I checked the sites that are linking to me, but they just link to my root address without index.html.

I use Wordpress, so my index file is index.php

I want to get rid of these crawl errors because I fear I'm losing SEO link juice. I think I need to 301 redirect the nonexistent index.html to the root of my website?

This is my current .htaccess code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I tried to add this line:

redirect 301 /index.html http://www.ciagent.com

But this 'breaks' my website.

What can I add to make sure that requests for index.html get properly redirected to my www.ciagent.com root?
Finne is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2010, 05:51 PM Re: 301 Redirect index.html to root
ModDish's Avatar
Super Talker

Posts: 116
Trades: 0
there must be something on your site thoe, that caused it to point to .html make sure you don't have the html extension in your sitemap

add a page to your site called index.html, then verify it with Google webmaster tools.

Than do a 301 redirect via google wt to your site, then delete the .html file

if not, your pr your gaining from the links will be lost to the .html file even if you redirect via a htaccess file.
__________________
Thanks
Evan
From ModDish -
Please login or register to view this content. Registration is FREE
ModDish is offline
Reply With Quote
View Public Profile
 
Old 07-22-2010, 05:53 PM Re: 301 Redirect index.html to root
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,390
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You cannot redirect a index file to the root without causing an infinite loop, as it is the index file that the server delivers on it's repeated request.

You need to use THE_REQUEST directive
http://www.highrankings.com/forum/in...howtopic=42402
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2010, 06:07 PM Re: 301 Redirect index.html to root
ModDish's Avatar
Super Talker

Posts: 116
Trades: 0
Quote:
Originally Posted by chrishirst View Post
You cannot redirect a index file to the root without causing an infinite loop, as it is the index file that the server delivers on it's repeated request.

You need to use THE_REQUEST directive
http://www.highrankings.com/forum/in...howtopic=42402
you can redirect a index.html to a index.php thoe.
__________________
Thanks
Evan
From ModDish -
Please login or register to view this content. Registration is FREE
ModDish is offline
Reply With Quote
View Public Profile
 
Old 07-22-2010, 06:08 PM Re: 301 Redirect index.html to root
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,390
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
you can redirect a index.html to a index.php thoe
And the point of that would be?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2010, 06:11 PM Re: 301 Redirect index.html to root
ModDish's Avatar
Super Talker

Posts: 116
Trades: 0
not much, i think someone that went on a linking spree for him, posted the wrong, link, so now they hit a .html page that doesn't exist.

so instead of linking to site.com ( which is a .php extention )

they linked to
site.com/index.html
__________________
Thanks
Evan
From ModDish -
Please login or register to view this content. Registration is FREE
ModDish is offline
Reply With Quote
View Public Profile
 
Old 07-22-2010, 06:29 PM Re: 301 Redirect index.html to root
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,390
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by ModDish View Post
not much, i think someone that went on a linking spree for him, posted the wrong, link, so now they hit a .html page that doesn't exist.

so instead of linking to site.com ( which is a .php extention )

they linked to
site.com/index.html
Nope.

It is to avoid splitting the links between the site root and ANY index page name. So redirecting from one index page name to another merely moves the problem.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2010, 06:39 PM Re: 301 Redirect index.html to root
Junior Talker

Posts: 4
Name: Finne Jager
Trades: 0
Quote:
Originally Posted by chrishirst View Post
You cannot redirect a index file to the root without causing an infinite loop, as it is the index file that the server delivers on it's repeated request.

You need to use THE_REQUEST directive
http://www.highrankings.com/forum/in...howtopic=42402
Thank you! I used the code from that topic and it seems to work. I hope the index.html crawl errors will start disappearing now.

Here is my new code:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?|php)(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?|php)$  http://www.ciagent.com/$1  [R=301,L]

RewriteCond %{HTTP_HOST}   ^ciagent\.com                     [NC]
RewriteRule  (.*)           http://www.ciagent.com/$1        [R=301,L]
</IfModule>
__________________
Digital Marketing & Webdesign
Please login or register to view this content. Registration is FREE
Finne is offline
Reply With Quote
View Public Profile
 
Old 03-14-2011, 10:56 AM Re: 301 Redirect index.html to root
Super Talker

Posts: 142
Name: Jim
Location: Nottinghamshire
Trades: 0
Chris I know its an old thread but I just wanted to thank you for the link to that piece of code been trying to re-direct index.html to my root for ages, just kept getting the infinate loop so thanks again.
jim25 is offline
Reply With Quote
View Public Profile Visit jim25's homepage!
 
Reply     « Reply to 301 Redirect index.html to root
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.84424 seconds with 12 queries