1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

RewriteMap problems

Discussion in 'Apache' started by GordonChow, Aug 16, 2015.

  1. #1
    RewriteMap problems
    How can i use RewriteMap and work with Alias (not affect the alias redirection) on Virtual Host?
    I hv no idea.

    <VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName resource.centos6-gordon.japan
    ErrorLog logs/error_log_192
    CustomLog logs/access_log_192 common

    RewriteEngine on
    Rewritelog /var/log/httpd/rewirte_log
    Rewriteloglevel 9

    RewriteMap redirectmap "txt:/etc/httpd/conf/mapredirect"
    RewriteRule "^/~?([^/]+)(/?|.*)$" ${redirectmap:$1|%{REQUEST_URI}} [PT]

    Alias /ming /home/Gordon/Ming
    Alias /dora /home/Gordon/Dora

    </VirtualHost>



    rewirte_log
    Code:
    RewriteRule "^/~?([^/]+)(/?|.*)$" ${redirectmap:$1|%{REQUEST_URI}} [PT]

    (2) rewrite '/gordon' -> '<URL>'
    (2) implicitly forcing redirect (rc=302) with <URL>
    (2) forcing '<URL>' to get passed through to next API URI-to-filename handler



    RewriteRule "^/~?([^/]+)(/?|.*)$" ${redirectmap:$1|%{REQUEST_URI}}

    (2) implicitly forcing redirect (rc=302) with <URL>
    (1) escaping h<URL> for redirect
    (1) redirect to <URL> [REDIRECT/302]
     
    GordonChow, Aug 16, 2015 IP