您好,欢迎访问一九零五行业门户网

请教大神htaccess文件规则

需求有俩个。
1.http自动跳转https
2.index.php屏蔽掉,thinkphp框架。
thanks
回复内容: 需求有俩个。
1.http自动跳转https
2.index.php屏蔽掉,thinkphp框架。
thanks
建议查看相关文档。http://www.htaccesseditor.com/sc.shtml 这里提供一个可以在线生成的web。
补充:http://hi.baidu.com/honfei/item/0893a6e12984903a4ddcafbc
一,http直接跳转到https
rewriteengine onrewritecond %{server_port} !^443$rewriterule ^(.*)?$ https://%{server_name}/$1 [l,r]
二,tp屏蔽index.php
如果是apache则需要在入口文件的同级添加.htaccess文件,内容如下:
rewriteengine onrewritecond %{request_filename} !-drewritecond %{request_filename} !-frewriterule ^(.*)$ index.php/$1 [qsa,pt,l]
nginx环境
在nginx低版本中,是不支持pathinfo的,但是可以通过在nginx.conf中配置转发规则实现:
location / { // …..省略部分代码 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }
thinkphp手册上都会有说明,建议仔细看一下 : )
其它类似信息

推荐信息