0

Apache – rewrite non www to www

Simple and quick one 🙂 Just to rewrite non www traffic to www in Apache you can use the following snippet

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ %{REQUEST_SCHEME}://www.%{HTTP_HOST}$1 [R=301,L]

 

rafpe

Leave a Reply

Your email address will not be published. Required fields are marked *