Developer forum

Forum » CMS - Standard features » Redirect 4000 links to a new domain

Redirect 4000 links to a new domain

Tomas Gomez
Reply

Hi,

We need to redirect about 4000 urls from an old domain to a new one. We got a file with the matches between the old and the new domain, and we have to activate it the day the new domain is launched.

In the documentation, we found that we could do it by setup (https://doc.dynamicweb.com/documentation-9/platform/platform-tools/redirects), but being so many redirections it is recommended to do it by the IIS or the web.config ("The Redirects tool is meant for simple setups - in more advanced scenarios please create your redirects directly in the web.config or IIS.")

Considering the large number of redirects, which is the more efficient way to do it? IIS or web.config? Are there any caveats or considerations?

Thanks for your help,
Tomas


Replies

 
Nicolai Pedersen
Reply

I would go for web.config

 
Søren Ravn Lund
Reply

It depends on how what the redirects look like.

Is it only the domain that change? Then you can use the IIS rewrite module.

 
Tomas Gomez
Reply

Thanks for the help!

It is not only the name of the domain. The URLs of the products change as well. For instance
- Origin: http://www.olddomain.es/es/microwave/f-001425
- Destination: http://www.newdomaindynamicweb.es/ovens-and-microwaves/microwaves/newmicrowave

About the redirection of the domains, in website settings I have to enter both domains, right?
Something like:
        newdomaindynamicweb.es 
        olddomain.es 
Is this ok?

And about the redirection of the pages, going for the web.config by Nicolai suggestion, I see that best option is to add a file with the redirections (rewritemaps.config).  This way, the web.config file would be something like:

<rewrite>
    <rewriteMaps configSource="rewritemaps.config" /><rules>
        <rule name="Redirect rule1 for Redirects">
            <match url=".*" />
            <conditions>
                <add input="{Redirects:{REQUEST_URI}}" pattern="(.+)" />
            </conditions>
            <action type="Redirect" url="{C:1}" appendQueryString="false" />
        </rule>
    </rules>
</rewrite>

And the rewritemaps.config:

<rewriteMaps>
    <rewriteMap name="Redirects">
        <add key="/es/microwave/f-001425 " value="/ovens-and-microwaves/microwaves/newmicrowave" />
    </rewriteMap>
</rewriteMaps>

Is this the right approach?

Thanks,
Tomas

 
Søren Ravn Lund
Reply

That is, what I would call, a simple redirect.

You have no logic that ties the origin to the destination. I would import them into DW's UrlPath.

Whether is more or less performant than going for rewrite maps, I don't know. Rewrite maps should be fine as well. 

If you go for Rewrite maps and you have a lot of redirects, then you might cause your web.config to be too large for the default limit, and you'll have to adjust this limit in windows regedit on every environment. More on the matter here: https://forums.iis.net/t/1196317.aspx?URL+Rewrite+External+Config+File+Too+Large+

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

DW Url Path is definately less performant because it's only triggered by the 404 handler, meaning DW will first try to resolve the URL and once it cannot, the 404 handler kicks in trying to find a matching page before returning the 404 page.

 

 

But the impact should be minimal and if you set them up as 301, you're bound to have less and less of those over time. It also provides you with some simple audit.

 

Best Regards,

Nuno Aguiar

 
Tomas Gomez
Reply

Thanks for the help :-)

We are reconsidering the DW's URL path to do it.

Søren, how could I import the redirections into UrlPath?  which type of integration? which DW tables are targeted?

Nuno, where is the audiut you mention? I cannot see it in the monitoring area.

As well, what about the redirection of the domain from the old to the new url? Is it just another redirection or is there any other configuration to achieve it?

Regards,
Tomas

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Tomas,

 

By "audit" I meant your ability to go to Url Redirects and see what's active, the status and how many "Visits" (hits) that redirect had

https://doc.dynamicweb.com/documentation-9/platform/platform-tools/redirects

 

When you have redirects in web.config or in IIS you don't have easy access to redirects, and certainly not any "visits" or "active" data on them.

 

I know you asked Soren, but I can tell you as well that the table is UrlPath and you can use the DataIntegration with the Dynamicweb Provider (as destination). That's how we do it.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum