Mod rewrite not working?

Discussion in 'Apache' started by raven2424, Aug 23, 2010.

  1. #1
    hey guys thanks for taking the time to look over my problem and help out!

    Mod rewrite used to work on my website but it no longer is working after some time i am not sure if the original htaccess was replaced by mistake or what but it is no longer working.

    This is my current htaccess file

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\.htm$ $1.php [L]
    Code (markup):
    my urls look like this with out the rewrite

    www.domain.com/index.php?done=mypage.php
    Code (markup):
    and i want them to look like this how they used to with the rewrite

    www.domain.com/mypage.htm
    Code (markup):
    hopefully someone here knows what i am doing wrong thanks for your time!
     
    Last edited: Aug 23, 2010
    raven2424, Aug 23, 2010 IP
  2. romika

    romika Member

    Messages:
    264
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #2
    romika, Aug 24, 2010 IP
  3. lostdesign39

    lostdesign39 Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    are you using shared hosting or do you run this server?
     
    lostdesign39, Sep 3, 2010 IP
  4. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #4
    Your file needs to look like this,

    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)\.htm$ index.php?done=$1 [L]
    
    Code (markup):
    And linking a file to this would be page.htm

    Kind regards,

    Glen Hughes
     
    HuggyEssex, Sep 3, 2010 IP