Redirect site.com to www.site.com

Designer
Van Canada
Lid sinds nov. 2018

Hi there, I have a .htaccess file on my home directory on the server which redirects https://airclix.com/ => https://www.airclix.com/

The rule is as follows:

301 --- https://airclix.com/ => https://www.airclix.com/

RewriteCond %{HTTP_HOST} ^airclix.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*)$ https://www.airclix.com/$1 [R=301,L]

When the url https://airclix.com is entered it is automatically redirected to https://www.airclix.com. However, when the url contains /webshop/ such as https://airclix.com/webshop/ it will not redirect to https://www.airclix.com/webshop/.  There is a also a .htaccess file in the "webshop" directory on the server which also has a rewrite rule as follows:

Redirect non-www to www

  #RewriteCond %{HTTP_HOST} !^www.
  #RewriteCond %{REQUEST_METHOD} !=POST
  #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

I wondering what I should do with 2 .htaccess files. Should there be only one? Should I delete one? Or what can I do so https://airclix.com/webshop/ redirects to https://www.airclix.com/webshop/

Thanks, 
Miles

tim
Founder
Van Sweden
Lid sinds mei 2013
tim

Uncomment the # before RewriteCond for it to have effect.

Designer
Van Canada
Lid sinds nov. 2018

Thanks! That was easy.  Works now.
Miles

Dit topic is gesloten wegens langdurige inactiviteit. Erop posten is niet mogelijk.
Deze website maakt geen gebruik van cookies en geen trackingtechnologie van derden . Wij denken dat we het beter kunnen dan anderen en hechten veel waarde aan uw privacy.