您现在的位置是:首页 > 网站建设常见问答网站建设常见问答
thinkphp 3.2.2在IIS配置伪静态去掉index.php
2017-02-23【网站建设常见问答】1868 人已围观
简介因为测试都是在win下开发的windows 7,然后配置的是iis ,今天需要去掉tp的index.php 我们需要做如下操作 首先安装 ...
因为测试都是在win下开发的windows 7,然后配置的是iis ,今天需要去掉tp的index.php 我们需要做如下操作
首先安装 Thinkphp 3.2.2
URL Rewrite Module 2.0
http://www.iis.net/downloads/microsoft/url-rewrite#additionalDownloads
上面地址选择 合适的版本下载安装
安装完成后 关闭IIS 在重新打开就可以看到url redirect控制图标就可以配置伪静态了.
详细代码如下
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value=\"index.php\" />
</files>
</defaultDocument>
<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>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value=\"index.php\" />
</files>
</defaultDocument>
<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>
关注宁波网站建设博客,更多精彩分享,敬请期待!
Tags:
很赞哦! ()
相关文章
随机图文
收集一些php常用img图像函数集
同学颤抖吧,PHP的GD是相当的丰富,有人能全部背出功能吗?! 我是不行,今天罗列PHP对图像处理的常用函数如下: gd_info函数:...殷雯jquery笔记:添加HTML元素
使用jQuery可以方便的添加新的HTML元素。这样就允许在客户端浏览器里进行一些动态操作,丰富了使用者体验。 下面的方法用于添加HTML...linux服务器一站多域名配置apache
在一台Linux服务器下我们一般都会放多个网站,这样我们就要在建立虚拟目录。有时一个网站也需要绑定多个域名,那么我们就需要配置虚拟。...div覆盖div DIV相互重叠如何解决
div覆盖div,出现div与div盒子之间产生重叠覆盖现象,而内容没有出现覆盖重叠现象原因与解决方法。 可能您遇到过上下结构的布局,...