Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http到Https重定向问题? #将HTTP重定向到HTTPS 重写cond%{HTTPS}=关于重写规则(.*)的问题 https://%{SERVER_NAME}/$1[R,L] #开始WordPress RewriteBase/blog/RewriteRule^index\.php$-[L]上的RewriteEngine 重写cond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-D 重写规则/blog/index.php[L] #结束WordPress_Php_Wordpress - Fatal编程技术网

Http到Https重定向问题? #将HTTP重定向到HTTPS 重写cond%{HTTPS}=关于重写规则(.*)的问题 https://%{SERVER_NAME}/$1[R,L] #开始WordPress RewriteBase/blog/RewriteRule^index\.php$-[L]上的RewriteEngine 重写cond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-D 重写规则/blog/index.php[L] #结束WordPress

Http到Https重定向问题? #将HTTP重定向到HTTPS 重写cond%{HTTPS}=关于重写规则(.*)的问题 https://%{SERVER_NAME}/$1[R,L] #开始WordPress RewriteBase/blog/RewriteRule^index\.php$-[L]上的RewriteEngine 重写cond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-D 重写规则/blog/index.php[L] #结束WordPress,php,wordpress,Php,Wordpress,这是我的网站访问代码。我想将我的站点http重定向到https。我尝试了一些代码,但没有工作如果您的站点位于服务器的根目录中,请使用以下代码 # Redirect HTTP to HTTPS RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBa

这是我的网站访问代码。我想将我的站点http重定向到https。我尝试了一些代码,但没有工作

如果您的站点位于服务器的根目录中,请使用以下代码

# Redirect HTTP to HTTPS 
RewriteCond %{HTTPS} !=on RewriteRule (.*) 
https://%{SERVER_NAME}/$1 [R,L]
# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L]   
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L] 
</IfModule>
# END WordPress
重新编写引擎打开
重写cond%{HTTPS}=在…上
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301,NE]
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
或 假设您的代码位于/blog/文件夹中。改为使用以下代码

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

重新编写引擎打开
重写cond%{HTTPS}=在…上
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301,NE]
重新启动发动机
重写库/博客/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/blog/index.php[L]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>