Results 1 to 2 of 2

Thread: 301 Redirect index.html to root (.htaccess)

  1. #1
    Join Date
    Jul 2010
    Posts
    4

    Lightbulb 301 Redirect index.html to root (.htaccess)

    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 use my root address without index.html in their links.

    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 link juice, so I want 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?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2010
    Posts
    4
    Try this one :

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.htm$ index.php [NC,R]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

Similar Threads

  1. .htaccess 301 redirect
    By cincydesign in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 22 Apr 2010, 09:14 AM
  2. 301 Redirect Question
    By robertuva in forum General Questions
    Replies: 0
    Last Post: 16 Oct 2008, 10:32 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •