RewriteCond REQUEST_URI - ^ doesn't work as expected

前端 未结 2 467
闹比i
闹比i 2021-02-10 16:54

I\'m building a site in codeigniter. I have a series of rewrite conditions & rules in the .htaccess file. The first set of rules turns SSL on or off depending on the first

2条回答
  •  盖世英雄少女心
    2021-02-10 17:56

    Try this one:

    RewriteCond %{HTTPS} off 
    RewriteCond %{HTTP_HOST} ^(.*)$ 
    RewriteRule ^/?(admin|secure)$ https://%1/$1 [R=301,L]
    

提交回复
热议问题