Mod_Rewrite Help

Discussion in 'Apache' started by Christian Little, Oct 26, 2007.

  1. #1
    I need some help with mod_rewrite.

    I want mod_rewrite to force all page requests to go through a single file called main.php.

    However I want robots.txt and a few other files to be served directly without going through main.php.

    Furthermore, I need it to serve like this:

    file server: main.php?c1=$1&c2=$2&c3=$c3
    where: www.example.com/$1/$2/$3.html

    Can somebody provide me with the code? I suck at writing mod_rewrite commands.
     
    Christian Little, Oct 26, 2007 IP
  2. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #2
    RewriteRule: /(.+)?/?(.+)?/?(.+).html /main.php?c1=$1&c2=$2&c3=$c3

    Maybe...
     
    Synchronium, Oct 26, 2007 IP