Skip to content

Instantly share code, notes, and snippets.

@krmgns
Last active August 29, 2015 14:13
Show Gist options
  • Save krmgns/c379057fc5ce584a38e2 to your computer and use it in GitHub Desktop.
Save krmgns/c379057fc5ce584a38e2 to your computer and use it in GitHub Desktop.
Proper .htaccess configrations for subdir-based virtual server (Apache/2.4.7 (Ubuntu)).
<VirtualHost *:80>
ServerName foo.com.local
DocumentRoot /var/www/foo.com/public
<Directory /var/www/foo.com/public>
Options +FollowSymLinks
DirectoryIndex index.php
AllowOverride all
Require all granted
# mvc
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment