How to implement URL rewrite in classic ASP using custom 404 page?
My web host told me that they are using Windows IIS (not sure about the version) and are unable to i开发者_JS百科mplement a URL rewrite for me. I am now looking at alternative ways to do this. Obviously, I don't have access to the IIS server. I read somewhere that using a custom 404 page, I am able to implement a URL rewrite from my end using classic ASP.
I want to do a URL rewrite for subdomain.mydomain.com to www.mydomain.com/subdomain.
I am a bit lost about the steps that must be taken to implement URL rewrite. Can someone take me through the steps?
Thanks
Request.ServerVariables("HTTP_HOST")
will give you the subdomain.
if Request.ServerVariables("HTTP_HOST")="subdomain.domain.com" then
response.redirect("http://domain.com/subdomain")
end if
You can get URL Rewriting on IIS6 with IIRF - it's free. If your web host can install it for you., it's easy to get rewrites on IIS. If the web host has IIS7 or later, then they can use the URL Rewriting module that's included in IIS7.
精彩评论