How to write mod_rewrite rules for apache

Discussion in 'Apache' started by topcattony, Mar 3, 2010.

  1. #1
    Hi I'm using Zend Framework with the following .htaccess file to route all traffic through my index.php page (except for images, css etc).
    I need to also make a particular directory exempt from the mod_rewrite, or alternatively files ending in .doc, .pdf .rtf.

    The existing .htaccess file looks like this:

    
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    
    RewriteCond %{REQUEST_FILENAME} -d
    
    RewriteRule ^.*$ - [NC,L]
    
    RewriteRule ^.*$ index.php [NC,L]
    
    Code (markup):
    Even if someone can recommend a good tutorial for learning how to write mod_rewrite rules that would be really useful.

    Thanks in advance.

    Tony
     
    topcattony, Mar 3, 2010 IP
  2. BrianM

    BrianM Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    BrianM, Mar 6, 2010 IP