开发者

Custom 404.asp possible for Rewrite?

开发者 https://www.devze.com 2023-03-10 20:33 出处:网络
I am building a site with many query string in classic asp like. category.asp?id-3 .. problem my host is not support Asapi Filter or other component.

I am building a site with many query string in classic asp like. category.asp?id-3 .. problem my host is not support Asapi Filter or other component.

Only 404. can support

can we rewrite .. category.asp?id开发者_运维百科= .. to be category/computer or category/computer/laptop ?


If I am understanding your request, you want to be able to redirect based on a 404 with custom rules top map those requests to another url.

This can be done by using a custom error page in IIS.

In IIS6, we could: create a virtual directory, and create an asp page. In this asp page, we then put in logic that will take a URL such as category.asp?id= and map it to category/computer/laptop, and do a Response.Redirect to the new url. (I am assuming you know how to set up an ASP website...)

Once this is done, go to the website settings in IIS for your original website, and select properties. Go to the Custom Errors tab, and choose 404 and edit.

In the next screen you will see a Message Type drop down, select URL. Put in the url to the page we created earlier.

Now the page will be able to take the url originally requested, map it to what it should be, and redirect, hopefully solving your problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消