我的服务器为windows环境,用IIS + Rewrite.dll + httpd.ini,程序为thinkphp.
用rewrite规则要如何写,才能首先访问index.html ,同时 入口文件index.php 还能隐藏?
谢谢大家了。
IIS下thinkphp默认访问index.html同时隐藏index.php
答案:3 悬赏:0
解决时间 2021-12-15 02:59
- 提问者网友:我喜歡係
- 2021-12-14 08:06
最佳答案
- 二级知识专家网友:不服输的倔强
- 2021-12-14 08:14
我记得thinkphp里面是不是有路由功能,你去看一下!
rewrite 规则
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/css/.*
RewriteCond %{REQUEST_URI} !^/scripts/.*
RewriteCond %{REQUEST_URI} !^/images/.*
RewriteRule ^.*$ index.html [QSA,NC,L]
rewrite 规则
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/css/.*
RewriteCond %{REQUEST_URI} !^/scripts/.*
RewriteCond %{REQUEST_URI} !^/images/.*
RewriteRule ^.*$ index.html [QSA,NC,L]
全部回答
- 1楼网友:冷眼_看世界
- 2021-12-14 10:42
在conf文件加下找到convention.php文件配置一下,开启URL重写机制
然后创建.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
- 2楼网友:嗷呜我不好爱
- 2021-12-14 09:50
这个是url重写吧,thinkPHP里四种重写的方式都可以实现的!
再看看别人怎么说的。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯