Created
September 5, 2012 07:39
-
-
Save tynovsky/3632721 to your computer and use it in GitHub Desktop.
apache virtualhost config file which imitates VirtualDocumentRoot with pure mod_rewrite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName lo | |
ServerAlias *.lo | |
DocumentRoot /home/miroslav/www | |
#do the magic: something.lo => DocumentRoot/something/document_root | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^([^.]*)\.([^.]*)$ | |
RewriteCond %{REQUEST_URI} !document_root | |
RewriteRule ^(.*)$ /%1/document_root$1 | |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
ErrorLog /var/log/apache2/lo_error.log | |
LogLevel debug | |
CustomLog /var/log/apache2/lo_access.log combined | |
ServerSignature On | |
RewriteLog "/home/miroslav/www/.log/lo_rewrite.log" | |
RewriteLogLevel 5 | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment