以前访问我网站首页的时候,地址栏有一个index.php,挺烦人的。我用这样的.htaccess表达式去除了index.php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
之后网站申请到了免费证书,我就想把http强制重定向https。于是在.htaccess底部加入这样的代码:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
然后,.htaccess就成了这样:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
FileETag none
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/css application/x-javascript
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 3 months"
</IfModule>
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
结果……index.php又出来了-_-||
怎么才能在强制http重定向到https的同时,去除首页的index.php呢?
请忽略deflate/expires两个模块下的内容,这些主要是优化网站缓存/脚本设置的,与url路由关系不大。
我还是小白中的小白……真心求助
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
之后网站申请到了免费证书,我就想把http强制重定向https。于是在.htaccess底部加入这样的代码:
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
然后,.htaccess就成了这样:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
FileETag none
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/css application/x-javascript
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 3 months"
</IfModule>
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
结果……index.php又出来了-_-||
怎么才能在强制http重定向到https的同时,去除首页的index.php呢?
请忽略deflate/expires两个模块下的内容,这些主要是优化网站缓存/脚本设置的,与url路由关系不大。
我还是小白中的小白……真心求助