Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple Apache2 Virtual Host for WordPress
<VirtualHost *:80>
ServerName wordpress.local
# Indexes + Directory Root.
DirectoryIndex index.php index.html
DocumentRoot /var/www/workspace/wordpress/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond $1 ^(index\.php)?$ [OR]
RewriteCond $1 \.(gif|jpg|png|ico|css|js)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ - [S=1]
RewriteRule . /index.php [L]
# END wordpress
Options FollowSymLinks
Order allow,deny
Allow from all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.