Created
January 8, 2013 08:48
-
-
Save masiorama/4482268 to your computer and use it in GitHub Desktop.
Apache: skel virtual host global rewrite www to non-www
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
<Directory /var/www/vhosts/@domain_name@/httpdocs> | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
</Directory> | |
#/var/www/vhosts/.skel/0/conf/vhost.conf | |
#/var/www/vhosts/.skel/0/conf/vhost_ssl.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment