mercredi 30 octobre 2019

Redirecting non-www to www but keeps the vanity URL

I'm trying to redirect a non-www to www but this time I want to keep the vanity URL. I've tried to search this over the internet but no luck at all.

So, here's the example I want to achieve:

http://exampledomain.com/vanity-url -> https://www.exampledomain.com/vanity-url

I've tried this code but it is deleting the vanity URL.

Redirects non-www to www

RewriteEngine On
RewriteCond %{HTTP_HOST} ^anderssorman-nilsson.com [NC]
RewriteRule ^(.*)$ https://www.anderssorman-nilsson.com/$1 [L,R=301]

Any help would be very much appreciated.




Aucun commentaire:

Enregistrer un commentaire