How to set redirection for a websites using .htaccess?
Redirects are automatic URL transfers. The user types a specific website into his browser, but because of a redirect he is forwarded to another URL.
Note that we can set the redirection fot the websites.
Kindly refer the below steps:
1) Redirection to www.domainname by using .htaccess
i) Login to cpanel of the domain for which you need to set the redirection
ii) Click the files manager under the files option
iii) Then click public_html
iv) Then click settings, in which enable show hidden files.
v) After that select .htaccess if already exist or create a new file in the name of .htaccess, then click edit and enter the below code
—
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
—-
* Replace domainname with your own domain name
By this way you can set the redirection for your websites.