Yii2 advanced app with SSL and pretty url and scriptname equal to false

Hello

i have to redirect my all http request to https page…

so i have following code in my .htaccess file


Options -Indexes


<IfModule mod_rewrite.c> 

  RewriteEngine on


  RewriteCond %{HTTPS} off

  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 


  RewriteCond %{REQUEST_URI} !^public

  RewriteRule ^(.*)$ frontend/web/$1 [L] 

</IfModule>


# Deny accessing below extensions

  <Files ~ "(.json|.lock|.git)">

    Order allow,deny

    Deny from all

  </Files>


# Deny accessing dot files

  RewriteRule (^\.|/\.) - [F]

It is not working … give me some suggetion…!!