ReWriteMap without httpd.conf

Discussion in 'Apache' started by Lpe04, Mar 7, 2009.

  1. #1
    Looking to do a rewritemap without httpd.conf access. Any other possibilities? (By the way, I know some PHP)

    Thanks!
     
    Lpe04, Mar 7, 2009 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    No. Have a look at the Context: section in the docs for 1.3. (It's the same for later versions.) You can only put RewriteMaps in httpd.conf or any Included files.

    You can emulate the functionality of a rewrite map using a generic rewrite:
    RewriteRule /redir/(.*) redir.php?redir=$1
    Code (markup):
    and then having your PHP code look up the $redir variable in a database and respond with:
    <?php
    header("Location: http://www.myredirectedsite.com");
    ?>
    PHP:
     
    Ladadadada, Mar 14, 2009 IP