Redirect non-www to www over http and https


Use the following .htaccess code to redirect non-www URLs to www over http and https

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 
</ifModule>

Was dit antwoord nuttig?

 Print dit artikel

Gerelateerde artikelen

.htaccess RewriteRule Examples

Example 1 Original URL: http://www.domain.com/product.php?id=15 Rewritten URL:...

Block Bad Bots and Spiders using .htaccess

Below is a useful code block for blocking a lot of the known bad bots and site rippers currently...

Set Timezone

Sometimes, when you using date or mktime function in php, it will show you a funny message...