我现有的完全从我的 URL.htaccess
中删除:index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|(.*)\.swf|images|robots\.txt|css|docs|cache)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 /application/errors/404.php
</IfModule>
我需要整个网站都通过 SSL 运行,而我的托管公司 Pagoda Box 有一个专有的.htaccess
编辑可以从切换http
到https
:
RewriteCond %{HTTP:X-Forwarded-Proto} = http
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
它仅在第一个条件语句的末尾添加时才有效,并且它完美地工作:它添加https
到裸 URL 并删除index.php
.
但是,如果您在地址栏中选择s
fromhttps
并将其删除,则index.php
返回,加上 URL 的最后一段重复。如果我键入以 开头的完整 url,http://
它会重定向并完美运行 - 只有当我将光标放在 前面s
并删除它时,站点才会中断。
关于如何阻止这个新条件和规则与我现有文件冲突的任何想法?