php-url-rewriting-with-htaccess-and-microsoft-iis-url-rewriting
2015-08-17 16:40
751 查看
If you use IIS 7 then you can use IIS URL Rewrite Module, that has an "Import
Rules" feature that can be used to translate mod_rewrite rules to IIS URL rewrite format. These particular rewrite rules will not translate because the RewriteCond uses the "-s" and "-l" flags which check if the requested URL corresponds to a non-zero
size file or to a symbolic link on a file system. If your application does not use any symbolic links then you can safely replace these conditions with:
and then convert the rules by using IIS URL Rewrite UI. That will result in these rules:
Rules" feature that can be used to translate mod_rewrite rules to IIS URL rewrite format. These particular rewrite rules will not translate because the RewriteCond uses the "-s" and "-l" flags which check if the requested URL corresponds to a non-zero
size file or to a symbolic link on a file system. If your application does not use any symbolic links then you can safely replace these conditions with:
RewriteCond %{REQUEST_FILENAME} -f [OR]
and then convert the rules by using IIS URL Rewrite UI. That will result in these rules:
<rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^.*$" /> <conditions logicalGrouping="MatchAny"> <add input="{REQUEST_FILENAME}" matchType="IsFile" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" /> </conditions> <action type="None" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^.*$" /> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite>
相关文章推荐
- PHP查询MySQL大量数据的内存
- 文本编辑器之editplus
- php利用api搜索下载it-ebooks.info上图书
- 【案例】小心,apc可能导致php-fpm罢工!
- php计划任务
- php生成二维码-PHP QR Code
- php变量声明时的单引号与双引号区别
- PHP常用函数
- 关于ThinkPHP常用的标签--适合菜鸟初学者
- phpstorm常用快捷键
- 关于yii的缓存的学习(学习自慕课网---与《YII框架》不得不说的的故事—高效篇)
- yii2如何引入自定义css或js文件
- PHP记住密码思路
- 如何在xampp中运行php文件
- PHP 输出变量结构信息到日志
- Yii中POS和GET并用范例
- PHP添加图片水印、压缩、剪切的封装类
- php单例模式数据库类的简单封装
- php的CURL简单实例
- PHP与JSON