Creating Redirects to go to main domain

Discussion in 'HTML & Website Design' started by bluewaves, Jul 18, 2010.

  1. #1
    I've been creating redirects for pages that I no longer have.

    The process has worked smoothly with the exception of one.

    Redirect /index.html http://www.mydomain.com/index.php

    I now have an index.php file and did get this to redirect to my index.php file.

    Shouldn't I also be able to redirect this

    Redirect /index.php http://www.mydomain.com/

    I got an error message for this. What am I doing wrong?
     
    bluewaves, Jul 18, 2010 IP
  2. bluewaves

    bluewaves Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I found the answer to this. If anyone else needs to know this. I added this to the .htacess file and it works.

    DirectoryIndex index.php
    RewriteBase /
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.mydomain.com/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
     
    bluewaves, Jul 19, 2010 IP