问题描述
RewriteEngine on
RewriteBase /version_X
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.PHP|images|files|icon|robots\.txt)
RewriteRule ^(.*)$ index.PHP?/$1 [L]
# Added for redirect to https
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
我正在使用Codeigniter。我的.htaccess位于project_root/version_X
目录中。所以我的项目根目录是project_root
,代码在version_X
中。
我的项目URL为http://subdomain.domain.com/version_X/login
。但是当我使用上述脚本时,它将重定向到https://subdomain.domain.com/version_X/index.PHP?/login
而不是https://subdomain.domain.com/version_X/login
。
我正在使用代理子域(aws)。
那么如何使用.htaccess重定向具有版本和SEO友好的强制https?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)