Skip to content

Instantly share code, notes, and snippets.

@fracasula
Created April 22, 2014 10:01
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 fracasula/11172699 to your computer and use it in GitHub Desktop.
Save fracasula/11172699 to your computer and use it in GitHub Desktop.
Force Wordpress to HTTP on non-admin URLs
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/www.example.com.crt
ServerName example.com
ServerAlias www.example.com
<Directory "/var/www/example/">
AllowOverride All
Order allow,deny
Allow from All
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/wp-(admin|login)(.*) [NC]
RewriteRule ^/(.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error_example_ssl.log
CustomLog ${APACHE_LOG_DIR}/access_example_ssl.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment