|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
The Web Buyer's Guide is your best source for white papers on a wide range of IT products and services. This Week's Featured White Papers: Help Simplify Virtualization by IBM
|
|
#1
|
||||
|
||||
|
IIS 301 redirect question dynamic url's
Greetings all. I have searched through the forums and I feel I need to ask...
what is the best way to implement 301's for a site whose structure is like this... shopdisplayproducts.asp? hid=1& id=18& cat=Audio+Preamps&prodid=1053& product=C46 This site has hundreds of pages (or rather hundreds of products that are being loaded by the dynamic url) Is there a method for me to grab the values for each of the querystring elements above? <%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.new-url.com/" %> Many Thanks |
|
#2
|
||||
|
||||
|
A 301 is a special header. So ASP and .NET both have the ability to do 301s. I'm not all that familiar with .NET but a quick search shows you can grab the query string via Request.QueryString
|
|
#3
|
||||
|
||||
|
The BEST way is to install a rewrite component and then just write the rules similar to how would in .htaccess on an Apache server.
I've used ISAPI Rewrite from Helicontech for years and have never had an issue with the software or the support.
__________________
hctibselgoogtonmai |
|
#4
|
||||
|
||||
|
I've used ISAPI as well (they are good). You are saying... install ISAPI on the new server and then search for rule at heliontech support?
You think that would be easier than trying to write my own asp code to grab the current queryString varialbles? Quote:
|
|
#5
|
||||
|
||||
|
Quote:
I can help with the rules if you have version two, if you have version three it's the same as mod rewrite. As far as the redirects go you should be able to set up a single rule that will redirect all url's that contain the same patterns of variables. Regarding the other option, perhaps I'm misunderstanding. Do you intend to do all of these redirects in IIS? |
|
#6
|
||||
|
||||
|
My thoughts were to either
A. put these files on my new server (I'm moving to a new environment) with traditional asp 301 redirect code in each or B. put the redirect code in IIS. I had ISAPI with my previous company so anythnig I get now would be the latest from HelionTech. My thoughts were that I could create some type of select case code directly into the 301 code for that pages that need it, like this... current url... shopdisplayproducts.asp?product=MC501 new url... products/MC501.asp 'code below dim pid pid = request.querystring("product") Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www.new-url.com/products/"&pid&".asp" Your thoughts? (thanks) |
|
#7
|
||||
|
||||
|
OK, was scratching my head for a minute thinking that you were redirecting pages on the same site, and if so, none of it makes sense. Looking back at your first post, sorry, it looks like you're sending everything to a new domain.
In that case your reasoning makes sense: request the query string and pass that into the on page redirect to the corresponding ID on the new site. What doesn't make sense is how you're going to display the rewritten url on the new site without a rewrite component installed. Seems that you might also do it in IIS, just Google IIS 301 site variables if you were going to keep the variables. As far as the version of ISAPI_Rewrite, lot's of support available for .htaccess on the web as in version three but if you're used to writing your rules in the httpd.ini file it will take some adjusting. |
![]() |
| Viewing: SEO Chat Forums > Other > HTML Coding > IIS 301 redirect question dynamic url's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|