Skip to content

Instantly share code, notes, and snippets.

@coeneivan
Forked from nicolasramy/wordpress.local
Created November 17, 2020 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coeneivan/04ae553964ca0f6e9435f976d4878028 to your computer and use it in GitHub Desktop.
Save coeneivan/04ae553964ca0f6e9435f976d4878028 to your computer and use it in GitHub Desktop.
Simple Apache2 Virtual Host for WordPress
<VirtualHost *:80>
ServerAdmin nicolas.ramy@hostname.com
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]
</IfModule>
# END wordpress
Options FollowSymLinks
Order allow,deny
Allow from all
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment