簡體   English   中英

從 wordpress htaccess 重定向到 http 到 https

[英]Redirect from wordpress htaccess to http to https

這是我的 wordpress htaccess 文件代碼。激活 ssl 證書后,現在我想將 http 重定向到 https。但它不起作用。什么是 .well-known/acheme-challenge?這個文件夾存在於我的根文件夾中。誰能幫我

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !
^/\.well-known/pki-validation/[A-F0-9]  {32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !
^/\.well-known/pki-validation/[A-F0-9]  {32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule . /index.php [L]`enter code here`

# 結束 WordPress

嘗試這個

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

請參考https://serverguy.com/servers/redirect-http-to-https/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM