Created
July 30, 2012 12:43
-
-
Save nicolasramy/3206657 to your computer and use it in GitHub Desktop.
Simple Apache2 Virtual Host for WordPress
This file contains 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> | |
ServerAdmin [email protected] | |
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> |
This could help:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName wordpress.local
# Indexes + Directory Root.
DirectoryIndex index.php index.html
DocumentRoot /var/www/workspace/wordpress/
<Directory "/var/www/workspace/wordpress">
AllowOverride All
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
# 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
LogLevel warn
CustomLog /var/log/apache2/wordpress-access.log combined
ErrorLog /var/log/apache2/wordpress-error.log
</VirtualHost>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice!