Apache Ubuntu 18.04 http and www issue

  • Job DurationLess than a week
  • Project LevelBasic Level
  • Project deadlineExpired

Project detail

I want to open my site as https://ananasma.com for all redirects… My site is not opening at all for 4 of the redirects. Really need some help…

ananasma.com (not working)
www.ananasma.com (not working)
http://ananasma.com (not working)
http://www.ananasma.com (not working)
https://ananasma.com
https://www.ananasma.com

I have following code in .htaccess file and 000-default.conf file. Please help.

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^ananasma.com$
RewriteRule ^(.)$ https://ananasma.com/$1 [L,R=301]

Site is working with https but its not opening with http and www.ananasma.com or ananasma.com

Skills Required

Industry Categories

Freelancer type required for this project