1
votes

I'm guessing this is actually an impossible task, but I thought I'd run it by StackOverflow to see if I'm wrong. Basically we have some dynamically created URLs for SEO purposes (around 300,000+ of them) and we want to do 301 redirects to them.

Our current URLs look like this:

http://www.site.com/<Brand>/<Product Name>/<productGuid>

Our old URLs looked something like this:

http://www.site.com/productpage.aspx?productGUID=<productGuid>

Google still has a load of the old URLs indexed, but we obviously want them to know that they should be replaced with our newer ones (and that it's not just duplicate content), hence the 301 redirects.

Our problem is that the <Brand> and <Product Name> parts of the new URLs are obviously dynamically created... making it impossible to create 301 redirects for them.

Or is it impossible?

Thanks for any ideas or advice on how we might get Google to start updating their indexed URLs to the new ones.

2
Can you post the Regex Rule your are using? <rewrite url... - James Lawruk

2 Answers

1
votes

On the code for your productpage.aspx page, set the Response.StatusCode and Response.RedirectLocation and end the Response.

Response.StatusCode = 301;
Response.RedirectLocation = "http://www.site.com/<Brand>/<Product Name>/<productGuid>";
Response.End();
1
votes

Create a new internal name for your Product page, for example: ProductPageInternal.aspx.

Rewrite all ProductPage.aspx traffic to a Redirect.aspx page which contains 301 redirect code to the new, nice url.(thekaido's idea)

Rewrite all new Urls to ProductPageInternal.aspx.

<rewrite url="~/ProductPage.aspx?GUID=(.+)" to="~/Redirect.aspx?productGUID=$1" /> 
<rewrite url="~/(.+)/(.+)/(.+)" to="~/productpageInternal.aspx?productGUID=$3" />