Need some .htaccess help - index.php -> /

Discussion in 'Apache' started by Thomas U, Oct 18, 2006.

  1. #1
    Hey everyone, I have a question about .htaccess.

    I'd like to 301 re-direct index.php to /. Is this possible?

    Also,

    I'd like to re-direct index.php?page=home to /.

    Any help would be VERY appreciated. Thanks :)
     
    Thomas U, Oct 18, 2006 IP
  2. sarathy

    sarathy Peon

    Messages:
    1,613
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #2
    though i dont know about modrewriting.,
    i think creating a 301 redirect for yourdomain.com/index.php to yourdomain.com will throw some looping error.
     
    sarathy, Oct 18, 2006 IP
  3. Thomas U

    Thomas U Active Member

    Messages:
    175
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    k, yea I was just wondering if it was possible. If not thats okay.
     
    Thomas U, Oct 18, 2006 IP
  4. tigrrra

    tigrrra Well-Known Member

    Messages:
    2,109
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    120
    #4
    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /

    RewriteRule / /index\.php

    this might work :)
     
    tigrrra, Oct 18, 2006 IP
  5. Thomas U

    Thomas U Active Member

    Messages:
    175
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Hmm, just tried that, it seemed to only break some images I had. Didn't re-direct anything. The index.php doesn't bother me too much, mainly I want to re-direct

    index.php?page=home to / or index.php.
     
    Thomas U, Oct 18, 2006 IP
  6. e_hippie

    e_hippie Guest

    Messages:
    32
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6

    Having this in the root will likely mess up references to files containted in subdirectories.
    Use with caution and test 1st.
     
    e_hippie, Oct 28, 2006 IP