How to make mod rewrite rules work on LOCALHOST?

Discussion in 'Apache' started by fatabbot, Feb 20, 2007.

  1. #1
    Hi,

    Is it possible to make mod_rewrite rules work on localhost?
    I assume it has something to do with rewritecond?

    I uncommented mod_rewrite in httpd.conf and restarted apache.
    Then i changed

    RewriteCond %{HTTP_HOST} !^www\.site\.com

    to

    RewriteCond %{HTTP_HOST} ^http://localhost/site/

    But nothing... the rewrite rules i specified in htaccess do not work on localhost.

    Any idea?
     
    fatabbot, Feb 20, 2007 IP
  2. rajnikant

    rajnikant Peon

    Messages:
    18
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes , mode-rewrite works in localhost.

    Please try with the following :

     
    rajnikant, Feb 20, 2007 IP
  3. Mxhub

    Mxhub Active Member

    Messages:
    474
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Try:

    RewriteCond %{HTTP_HOST} !^localhost/site
     
    Mxhub, Feb 21, 2007 IP