Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

apache rewrite www to non www

#enable rewrite module with: sudo a2enmod rewrite

#ad this to your VirtualHost config or /.htacess file
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#restart apache: /etc/init.d/apache2 restart
 
PREVIOUS NEXT
Tagged: #apache #rewrite #www #www
ADD COMMENT
Topic
Name
6+4 =