0

I have in my folder .htaccess which redirects all the sites to https. I want to only redirect awesomesites.com to https.

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.awesomesites\.com [NC]
RewriteRule ^(.*)$ https://awesomesites.com/$1 [R=301,L]

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

currently it redirects all the sites to the https.

user50946
  • 473
  • 2
  • 7
  • 18
  • 1
    Possible duplicate of [Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod\_Rewrite Rules but Were Afraid to Ask](http://serverfault.com/questions/214512/redirect-change-urls-or-redirect-http-to-https-in-apache-everything-you-ever) – user9517 Mar 08 '16 at 22:04

1 Answers1

1

You can just add another condition to your HTTPS redirect like so:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} awesomesites\.com [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

This will redirect only traffic to the awesomesites.com domain to HTTPS

MoeBrowne
  • 336
  • 1
  • 5