专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016      微信咨询  |  联系我们

WIN IIS7.0 Rewrite 伪静态设置使用说明

当前位置:网站建设 > 技术支持
资料来源:网络整理       时间:2023/2/14 0:03:01       共计:3633 浏览
 

WIN IIS7.0 Rewrite 伪静态设置使用说明【godaddy WIN .NET/PHP空间IIS7.0伪静态设置】
网站根目录建立 Web.Config 配置文件(文件名大小写敏感!)
Web.Config 添加规则:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rewrite to index.php" stopProcessing="true">
                    <match url="^index.html" />
                    <action type="Rewrite" url="index.php"  />
                </rule>
                <rule name="Rewrite to article.php" stopProcessing="true">
                    <match url="^article_(\d+).html" />
                    <action type="Rewrite" url="article.php?id={R:1}" />
                </rule>
                <rule name="Rewrite to list.php" stopProcessing="true">
                    <match url="^list_(\d+)_(\d+).html" />
                    <action type="Rewrite" url="list.php?id={R:1}&amp;page={R:2}" />
                </rule>
                <rule name="Rewrite to sitemap.php" stopProcessing="true">
                    <match url="^sitemap.xml" />
                    <action type="Rewrite" url="sitemap.php"  />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>     
</configuration>
保存修改!
建立 index.php
<?php
echo "Hello World";
?>
测试:
http://网址/index.html,如网页中有Hello World!则配置成功!如需要可以配置更多的规则!
上述是针对PHP配置的规则,ASP.NET同理!
注:
1、配置文件名Web.Config大小写注意;
2Web.Config必须放到网站根目录;
3、规则一定要写正确,多个传值时“&”在规则中是“&amp;”
4、在伪静态前一定要看看空间支持哪种方式的静态,查看phpinfo();Server APICGI/FastCGI还是Apache Handler,伪静态文件是httpd.ini/.htaccess/Web.Config

版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
·上一条:IIS7/IIS7.5 二级域名伪静态设置方法 | ·下一条:Jquery写的一个超强的树形结构分类菜单多选框checkbox功能

Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有    粤ICP备16019765号 

广州京杭网络科技有限公司 版权所有