这篇文章介绍的内容是关于thinkphp 隐藏index.php iis apache nginx ,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
针对不同的web服务器,iis7 apache nginx 可以使用不同的方法来进行配置
1.iis7 在站点根目录下添加web.config
添加内容
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)$" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>重启iis生效
2.apache 在根目录下添加 .htaccess 添加内容:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
jquery返回顶部隐藏按钮 , 这个在商城网站用的是很多的,商品的信息很长,通过鼠标滚轮返回到顶部,那就out了,所以,商城的产品信息页面会有一个返回顶部的按钮!php中文网推荐下载!
165
重启apache 生效
3.对于nginx 添加内容到站点配置文件,然后重载配置文件生效
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}相关推荐:
thinkphp隐藏index.php/home,并允许访问其他模块
thinkphp隐藏中url的index.php,thinkphpindex.php_PHP教程
以上就是thinkphp 隐藏index.php iis apache nginx 的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号