Web :: General :: redirecting with IIS - redirection permanente d'URL avec IIS |
|||
| By: Bernard |
Date: 05/04/2006 09:27:40 |
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 | 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 | Type : Comment |
|
| other advices ? | |||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








