Php codeigniter,htaccess强制https,一个url除外
我尝试将所有url强制为https,除了一个url。到目前为止没有成功。有人知道我的htaccess或Codeigner有什么问题吗 Url测试1: 应该保持原样 Url测试2: 我使用此工具测试htaccess: 这是我的访问权限Php codeigniter,htaccess强制https,一个url除外,php,apache,.htaccess,codeigniter,mod-rewrite,Php,Apache,.htaccess,Codeigniter,Mod Rewrite,我尝试将所有url强制为https,除了一个url。到目前为止没有成功。有人知道我的htaccess或Codeigner有什么问题吗 Url测试1: 应该保持原样 Url测试2: 我使用此工具测试htaccess: 这是我的访问权限 RewriteOptions inherit RewriteEngine on RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^/utility/mandrills/email_bounced_b
RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/utility/mandrills/email_bounced_back
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !^/(assets|test)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php/$1 [PT,L]
Header set Access-Control-Allow-Origin "*"
测试,工作
在浏览器上测试,
重定向到
apache配置文件:
<VirtualHost *:80>
ServerAdmin test@test.com
ServerName hub-dev-1.andatech.com.au
ServerAlias www.hub-dev-1.andatech.com.au
DocumentRoot /home/thehub/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/thehub/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Hak apache 2.2
# Order deny,allow
Allow from all
# Hak apache 2.4
Require all granted
</Directory>
</VirtualHost>
服务器管理员test@test.com
ServerName hub-dev-1.andatech.com.au
ServerAlias www.hub-dev-1.andatech.com.au
DocumentRoot/home/thehub/public\u html
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
选项索引跟随符号链接多视图
允许超越所有
#hakapache2.2
#命令拒绝,允许
通融
#hakapache2.4
要求所有授权
ssl apache配置
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin test@test.com
ServerName hub-dev-1.andatech.com.au
ServerAlias www.hub-dev-1.andatech.com.au
DocumentRoot /home/thehub/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/thehub/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# Hak apache 2.2
# Order deny,allow
Allow from all
# Hak apache 2.4
Require all granted
</Directory>
SSLCertificateFile /etc/letsencrypt/live/hub-dev-1.andatech.com.au/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hub-dev-1.andatech.com.au/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
服务器管理员test@test.com
ServerName hub-dev-1.andatech.com.au
ServerAlias www.hub-dev-1.andatech.com.au
DocumentRoot/home/thehub/public\u html
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
选项索引跟随符号链接多视图
允许超越所有
#hakapache2.2
#命令拒绝,允许
通融
#hakapache2.4
要求所有授权
SSLCertificateFile/etc/letsencrypt/live/hub-dev-1.andatech.com.au/fullchain.pem
SSLCertificateKeyFile/etc/letsencrypt/live/hub-dev-1.andatech.com.au/privkey.pem
Include/etc/letsencrypt/options-ssl-apache.conf
它在下一轮中确实获得了index.php
。也许RewriteRule^/?index\.php-[L]
作为一个顶级规则可以解决这个问题。确切地说,第二个规则是prepending index.php,然后它(内部)返回到重写管道的顶部,在第二个过程中它不会被RewriteCond%{REQUEST\u URI}捕获^/实用程序/mandrill/email\u反弹回来
(因为索引,php),因此被重写为https。例如,您可以从RewriteCond%{REQUEST\u URI}中删除^
^/实用程序/山楂树/电子邮件\u反弹\u回来
对不起,第二关是什么?我认为第一条重写规则失败,然后能够满足第二条重写规则。这是index.php。最后一个重写规则有[PT,L],因此这是最终规则。没有……?没有: