-1

I'm starting to develop a new big app, and I'm using Laravel 8 this time, and it's the first time.

I trying to Redirect HTTP to HTTPS with .htaccess file but unfortunately it's not working https://app.workfromhere.com.my/ please help me thanks.

.htaccess

  <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

   RewriteCond %{HTTPS} off
   RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

   # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Iqra Mukhtar
  • 29
  • 1
  • 3
  • Does this answer your question? [http to https through .htaccess](https://stackoverflow.com/questions/10489895/http-to-https-through-htaccess) – Mohamed Gamal Eldin Oct 08 '22 at 18:05
  • Actully this is a sub domain of which i want to change http is it possible for sub domain ? – Iqra Mukhtar Oct 08 '22 at 18:14
  • Does this answer your question? [How to redirect all HTTP requests to HTTPS using .htaccess rules?](https://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https-using-htaccess-rules) – Don't Panic Oct 09 '22 at 01:36

1 Answers1

0

I found out you are using cPanel, you can set Force HTTPS Redirect in Domains tap.

enter image description here

Mohamed Gamal Eldin
  • 680
  • 1
  • 6
  • 18