How to redirect domain with www ?

Step 1:  Create/Edit a file .htaccess in the documbent root (public_html / www folder)
of your hosting account and put the code below inside .htaccess file :

#----------------------------------------------------------
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^my-site.com [nc]
rewriterule ^(.*)$ https://www.my-site.com/$1 [r=301,nc]
#----------------------------------------------------------



Step 2:  replace domain name in code "my-site.com" to your domain site's domain name.

Step 3: Save / upload file into your hosting server and you done !


After this your is site now add www. when someone open it without www format.



Byla tato odpověď nápomocná?

 Tisknout tento článek

Také čtěte

How to redirect old domain to new domain ?

Step 1:  Create/Edit a file .htaccess in the documbent root (public_html / www folder)of your old...

HOW TO INCREASE FILE UPLOAD SIZE IN ZPANEL / SENTORA

Increasing Max Upload Size in ZPanel / SENTORA / Linux VPS / CentOs 6 ZPanel / Sentora server...

How to redirect old URL to new URL ?

Step 1:  Create/Edit a file .htaccess in the documbent root (public_html / www folder)of your...

How to force all web traffic to use HTTPS ?

// // SSL Certificate Properly Installed & Working Require, To Use It.If you've no SSL...

How to change MySQL mode / Remove ONLY_FULL_GROUP_BY?

How to change MySQL mode / Remove ONLY_FULL_GROUP_BY?Method 1:Remove ONLY_FULL_GROUP_BY from...