fracasula
4/22/2014 - 10:01 AM

Force Wordpress to HTTP on non-admin URLs

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>