|
|
|
start date: Mon, 13 Aug 2007 04:00:13 -0000,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
myalo
|
|
2
Scott M. am
|
|
3
George Ter-Saakov
|
|
4
Scott M. am
|
|
5
myalo
|
Advanced redirect
In the transition of a website from one domain to another for exmaple
from www.oldsite.com to www.newsite.com I need to "rewrite" the URL so
all links to the old site will be linked to the new site as follows:
1. For URLs that reference pages:
Change http://www.oldsite.com/dir1/content/content.aspx?p1=1&p2=2
into http://www.newsite.com/dir1/content/content.aspx?p1=1&p2=2
2. For URLs that reference sub domains:
Change http://subdomain.oldsite.com to http://subdomain.newsite.com
3. For URLs that reference sub folders
change http://www.oldsite.com/sub1
to http://www.newsite.com/sub1
How can it be done?
If it can be done with RewritePath method of HTTPContext, can someone
show me simple code?
Thanks
Date:Mon, 13 Aug 2007 04:00:13 -0000
Author:
|
Re: Advanced redirect
Find & Replace?
"myalo" wrote in message
news:1186977613.775912.241730@i38g2000prf.googlegroups.com...
> In the transition of a website from one domain to another for exmaple
> from www.oldsite.com to www.newsite.com I need to "rewrite" the URL so
> all links to the old site will be linked to the new site as follows:
> 1. For URLs that reference pages:
> Change http://www.oldsite.com/dir1/content/content.aspx?p1=1&p2=2
> into http://www.newsite.com/dir1/content/content.aspx?p1=1&p2=2
> 2. For URLs that reference sub domains:
> Change http://subdomain.oldsite.com to http://subdomain.newsite.com
> 3. For URLs that reference sub folders
> change http://www.oldsite.com/sub1
> to http://www.newsite.com/sub1
> How can it be done?
> If it can be done with RewritePath method of HTTPContext, can someone
> show me simple code?
> Thanks
>
Date:Mon, 13 Aug 2007 01:07:56 -0400
Author:
|
Re: Advanced redirect
On Aug 12, 10:07 pm, "Scott M." <s-...@nospam.nospam> wrote:
> Find & Replace?
>
I tested that and could not get it work. As I understand (unless I am
missing something here) HTTPContext.RewritePath can change the
"internal path" only such as http://www.oldsite.com/product1 to
http://www.oldsite.com/products.aspx?id=1. It cannot change it to
http://www.newsite.com/product1. Is there a way to change the URL
itself and not only the internal path?
I can use redirect but that gets tricky. When I tried it I got into a
loop as the redirection triggered the handler again and again. I might
be doing something wrong.
Do you have any idea how can do that?
Thanks
Moshe
Date:Mon, 13 Aug 2007 20:13:50 -0000
Author:
|
Re: Advanced redirect
The RewritePath only works within application. You can not rewrite path to
different URL than the one that is "belongs" to the application.
Hence you can not Rewrite it to different domain name. Response.Redirect
should work just fine.
Why do you redirect to the http://www.newsite.com/product1
Your newsite.com should do the Rewrite to /products.aspx?id=1
George.
"myalo" wrote in message
news:1187036030.688238.319090@j4g2000prf.googlegroups.com...
> On Aug 12, 10:07 pm, "Scott M." <s-...@nospam.nospam> wrote:
>> Find & Replace?
>>
> I tested that and could not get it work. As I understand (unless I am
> missing something here) HTTPContext.RewritePath can change the
> "internal path" only such as http://www.oldsite.com/product1 to
> http://www.oldsite.com/products.aspx?id=1. It cannot change it to
> http://www.newsite.com/product1. Is there a way to change the URL
> itself and not only the internal path?
> I can use redirect but that gets tricky. When I tried it I got into a
> loop as the redirection triggered the handler again and again. I might
> be doing something wrong.
> Do you have any idea how can do that?
> Thanks
> Moshe
>
Date:Mon, 13 Aug 2007 16:26:10 -0400
Author:
|
Re: Advanced redirect
"myalo" wrote in message
news:1187036030.688238.319090@j4g2000prf.googlegroups.com...
> On Aug 12, 10:07 pm, "Scott M." <s-...@nospam.nospam> wrote:
>> Find & Replace?
>>
> I tested that and could not get it work. As I understand (unless I am
> missing something here) HTTPContext.RewritePath can change the
> "internal path" only such as http://www.oldsite.com/product1 to
> http://www.oldsite.com/products.aspx?id=1. It cannot change it to
> http://www.newsite.com/product1. Is there a way to change the URL
> itself and not only the internal path?
> I can use redirect but that gets tricky. When I tried it I got into a
> loop as the redirection triggered the handler again and again. I might
> be doing something wrong.
> Do you have any idea how can do that?
> Thanks
> Moshe
I say again... Find & Replace?
Date:Tue, 14 Aug 2007 12:49:55 -0400
Author:
|
|
|