您现在的位置是:首页 > 网站建设常见问答网站建设常见问答
thinkphp 3.2.2在IIS配置伪静态去掉index.php
2017-02-23【网站建设常见问答】1626 人已围观
简介因为测试都是在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:
很赞哦! ()
相关文章
随机图文
殷雯jquery笔记:删除HTML元素
jQuery使用下面两个方法来删除或是清空某个HTML元素。 remove() – 删除指定的元素(包括其子元素) empty() – ...网页设计应该专注可用性和使用效果
使用对称的代码写法 构建响应式网站过程复杂,网站整体布局都应通过HTML和CSS代码库进行编码。在设计有关网页可用性的步骤时,强烈建议设计...最全的微信公众号图文内容添加超链接的方法总结
现在微信营销有种会替代网络营销的感觉,微信广告是铺天盖地的出来。微信在早期是允许用户在后台发布文章时自己定义链接,包括文字链接和图片链接。...分析网站跳出率:页面质量的重要性
影响网站排名的因素高达200多项,想要都熟练掌握对于新手SEOer绝对很困难,但是这并不意味着就无法做好网站排名。这里殷雯告诉新手一个小秘密...