problem getting mod_rewrite to work

Discussion in 'Server Operation' started by stenzlem, Jun 14, 2006.

  1. stenzlem

    stenzlem New Member

    I am trying to get mod_rewrite to work on my server. I'm using Apache 2.0 with Red Had Linux. I developed some rules on my dev box that worked fine, but when I tried modifying my live server, it was not even attempting to apply the rewrite rules.

    I tried making a very basic rule just to see the rewrite work on my live server with:

    LoadModule rewrite_module modules/mod_rewrite.so

    RewriteEngine on
    RewriteLog logs/rewrite
    RewriteLogLevel 9
    RewriteRule ^/foobar/$ /newfoobar [PT]

    and it does not write anything to the rewrite log nor does it rewrite the url. It just gives me a 404 error in the error log because /foobar does not exist.

    There are no other references to RewriteEngine in any of the conf files. Any help on why this is not working would be much appreciated!

    -Mike
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you insert these rules in the vhost or in an htaccess file.
     
  3. stenzlem

    stenzlem New Member

    I inserted it in the http.conf file before any of the virtualHost directives.

    -Mike
     
  4. falko

    falko Super Moderator ISPConfig Developer

    You must put

    Code:
    RewriteEngine on
    RewriteLog logs/rewrite
    RewriteLogLevel 9
    RewriteRule ^/foobar/$ /newfoobar [PT]
    into the virtual hosts, otherwise it wil work only for the server's main web site.
     

Share This Page