301RedirectModule icon indicating copy to clipboard operation
301RedirectModule copied to clipboard

I can't make it work with existing pages redirecting to another page

Open GonzaloCalandria opened this issue 8 years ago • 6 comments

Hello, i'm trying to redirect an existing page (Url Redirect item) to another existent page and it doesn't work at all.

The configuration is: Requested Url: /Careers Response Status Code: 301 Redirect To Item: /MyNewCareers

The /Careers item exists The /MyNewCareers item exists

if i go to my site root /Careers it goes to /Careers and no to /MyNewCareers if i change the Requested Url setting to /testing (item doesn't exists), then if i go to my site root /testing, the redirect works and it goes to /MyNewCareers

Why this is happening? do i miss something?

GonzaloCalandria avatar Mar 06 '17 18:03 GonzaloCalandria

Is the redirect module installed in your pipeline before the Item resolver? This behavior could be explained by it being in the other order, because non-found items wouldn't be resolved and thus passed through to the redirect module.

cadamsdotcom avatar Mar 06 '17 18:03 cadamsdotcom

How can i see if this is how you say?

GonzaloCalandria avatar Mar 06 '17 19:03 GonzaloCalandria

That's what pipeline says about the redirect module (i think)

<httpRequestBegin>    
    <processor type="SharedSource.RedirectModule.Processors.RedirectProcessor,SharedSource.RedirectModule" patch:after="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']"/>
   </httpRequestBegin> 

GonzaloCalandria avatar Mar 06 '17 19:03 GonzaloCalandria

I have changed the patch:after for patch:before and now it works! that was the problem? why the module is installed with a configuration that doesn't work? or i'm wrong?

GonzaloCalandria avatar Mar 06 '17 19:03 GonzaloCalandria

I wonder if the default changed in Sitecore 8! Glad this solved your problem! If you get the time and have a chance, a pull request would be very welcome!

cadamsdotcom avatar Mar 06 '17 19:03 cadamsdotcom

I have changed the patch:after for patch:before and now it works! that was the problem? why the module is installed with a configuration that doesn't work? or i'm wrong?

I also faced the same scenario and this setting also works for me, I just want to confirm if we change this setting to prod it doesn't impact the current redirects or anywhere else

nag-abhishek avatar Aug 24 '22 07:08 nag-abhishek