Home Virtual host with dynamic directory tag and mod-rewrite?
Reply: 0

Virtual host with dynamic directory tag and mod-rewrite?

John
1#
John Published in 2017-12-04 14:27:55Z
UseCanonicalName    Off
VirtualDocumentRoot "/mnt/af6d0917-23b2-4d97-afba-3bd859ba5f44/Work/%0/www/"

<VirtualHost *:80>

        ServerAdmin webmaster@localhost

    DocumentRoot /mnt/af6d0917-23b2-4d97-afba-3bd859ba5f44/Work/%0/www/
    <Directory /mnt/af6d0917-23b2-4d97-afba-3bd859ba5f44/Work/%0/www/>
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

        #rewrite all requests from the base / to /page_loader.php with the exception of images and js files
        RewriteBase /
        RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|PNG|swf|css|html|js|ico|pdf|otf|eot|svg|ttf|map|woff|woff2)$
        RewriteCond %{REQUEST_URI} !^/page_loader.php$
        RewriteCond %{REQUEST_URI} !^/page_loader.php/
        RewriteRule ^(.*)$ page_loader.php/$1?%{QUERY_STRING} [L]
    </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I have the above vhost file, it maps all traffic to a www folder within a dynamic parent folder name.

The thing is though it loads the index.php and ignores the mod-rewrite. On static vhost conf file, the above rewrites map all traffic to a file named page_loader.php

is it possible to use mod-rewrite within a dynamic vhost file?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321864 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO