visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Web :: General :: redirecting with IIS - redirection permanente d'URL avec IIS


By: Bernard France  Date: 05/04/2006 09:27:40  English  Points: 20 Status: Answered
Quality : Excellent
I split my web site and I moved one of the folders to a new url.

I would like to redirect all others' links from the old site to the new one

http://oldURL.org/oldFolder/somescript.asp?id=2

I would like to redirect that to :

http://newURL.org/newFolder/somescript.asp?id=2

What would be the best approach ?
(can it even be done with IIS?)
By: VGR Date: 05/04/2006 09:32:17 English  Type : Answer
1) If it were Apache, you can do it with an entry in the .htaccess or with a rewrite rule.

I'm pretty sure you can find on Google the solution to your problem. I would start with "+redirect +IIS" or "what equivalent rewriterule +IIS"

2) you could also probably use a custom 404 page , using SSI (if I remember well)

3) you can also work around the problem by leaving special scripts at the old locations, and systematically redirect internally to the new location, with something like :

<?php header("Location: newurl{$PATH_INFO}{$QUERY_STRING}"); exit;


(or the like, I didn't check for all possibilities. You could also check the $_POST and $_GET arrays to know what to redirect exactly )

I found this as a possibility with IIS/ASP :

<% Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://www.newurl.org" _ &Mid(Request.ServerVariables("SCRIPT_NAME") , 11, 200) _ & "?" & Request.ServerVariables("QUERY_STRING") Response.End %>



4) A RewriteRule is definitely simplier, but you've to either (1) find a way to do it in IIS, (b) upgrade to Apache ;)

By: Bernard Date: 08/04/2006 11:49:58 English  Type : Comment
other advices ?

Do register to be able to answer

EContact
browser fav
page generated in 295.864820 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page