您现在的位置是:首页 > 网站建设常见问答网站建设常见问答
thinkphp 3.2.2在IIS配置伪静态去掉index.php
2017-02-23【网站建设常见问答】1921 人已围观
简介因为测试都是在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:
很赞哦! ()
相关文章
随机图文
base64_decode编码遇到的加号问题
今天在一个项目里遇到了一个奇怪的问题。项目需求在地址栏里对中文进行编码传送,防止一些数据暴露给客户(当然懂一点程序的人员还是很容易对base...【网站内容建设】避免自己的页面成为搜索引擎的补充材料
我们在网站制作与推广的时候发现,有些网站内容虽然被收录,但仅仅是被作为一个补充材料被收录。补充材料就是搜索引擎辅助索引的一部分,这些内容...建站过程中网站服务器稳定与否与百度之间的关系
我们的公司企业在做好网站后,都需要放置到服务器上以供网络上的用户随时可以访问,这时就会有服务器稳定性的问题。如果企业网站放在了不稳定的机房...百度搜索的彩蛋!
今天无意搜索“翻转”,结果百度出来了让我惊讶的效果哈,各位不妨也试试!是的我的浏览器跟着也旋转了! 赶紧再查,原来百度从很早推出 ...