Forums / General Questions / Redirect Http to www

Redirect Http to www

Views: 838

Results 1 to 4 of 4
9 Apr 2011, 5:46 PM
#1
blisztec avatar

blisztec

New Zenner

Join Date:
Mar 2011
Posts:
5
Plugin Contributions:
0

Redirect Http to www

Is it possible to have it set so that if people come to my site via
example.com would get redirect to https://www.example.com?

9 Apr 2011, 6:16 PM
#2
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Redirect Http to www

add the following code to your root .htaccess file:

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

This will ensure that if you type in ‘example.com’, it will automatically redirect your visitor to the www version on your site.

*Note: this will only work if your host works with Linux servers with Apache mod-rewrite.

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

10 Apr 2011, 10:23 PM
#3
blisztec avatar

blisztec

New Zenner

Join Date:
Mar 2011
Posts:
5
Plugin Contributions:
0

Re: Redirect Http to www

Which is my root .htacces I seem to have a few?

23 Apr 2011, 10:05 PM
#4
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Redirect Http to www

Your root directory is example.com

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !