经典 ASP 中的自定义 URL 重写 [英] Custom URL Rewriting in Classic ASP

查看:24
本文介绍了经典 ASP 中的自定义 URL 重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试用经典的 ASP 重写 URL.我目前使用的是 IIS 7.5.我尝试使用转换以下链接的 URL Rewrite 插件:

I have been trying to rewrite the URL in classic ASP. I am currently using IIS 7.5. I tried to use the URL Rewrite plugin which converts the following link:

http://blog.johnavis.com/blog/default.asp?id=19

变成这样:

blog.johnavis.com/19/

blog.johnavis.com/19/

blog.johnavis.com/id/19/

blog.johnavis.com/id/19/

blog.johnavis.com/blog/default/19

blog.johnavis.com/blog/default/19

blog.johnavis.com/blog/default/id/19

blog.johnavis.com/blog/default/id/19

我想转换成这样:http://blog.johnavis.com/blog/myblog/

这能实现吗?任何帮助将不胜感激.

Can that be achieved? Any help would be appreciated.

推荐答案

重写模块所做的基本上就是编辑您的 web.config 文件.您最好自己编辑文件.你会发现它创建了一个名为rewrite的部分,添加如下规则

Basically all the rewrite module does is to edit your web.config file. You're probably better off editing the file yourself. You'll find that it has created a section called rewrite, add the following rule

        <rewrite>
            <rules>
                <rule name="My Blog">
                    <match url="blog/myblog/" />
                    <action type="Rewrite" url="blog/default.asp?id=19" />
                </rule>

            </rules>
        </rewrite>

这篇关于经典 ASP 中的自定义 URL 重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆