htaccess, Redirect all requests to https://

后端 未结 2 1820
一个人的身影
一个人的身影 2021-01-16 03:40

Using .htaccess, I need to redirect all requests from

https://www.domain

to

https://domain

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 04:03

    Assuming you have mod_rewrite enabled in your Apache configuration, you will need this in your .htaccess file.

    RewriteEngine On 
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://example.com/$1 [R,L]
    

提交回复
热议问题