Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active October 4, 2018 14:23
Show Gist options
  • Save ziadoz/5320590 to your computer and use it in GitHub Desktop.
Save ziadoz/5320590 to your computer and use it in GitHub Desktop.
Debugging Apache Virtualhosts
<VirtualHost *:80>
ServerName example.dev
DocumentRoot /var/www/vhosts/www.example.com/public
# Enable Rewrite Log Debugging (Apache 2.2)
RewriteLog /var/www/vhosts/www.example.com/rewrite.log
RewriteLogLevel 6
# Enable Rewrite Log Debugging (Apache 2.4)
# LogLevel alert rewrite:trace6
<Location />
# Strip PHP File Extension
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L,QSA]
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment