SyliusRedirectPlugin icon indicating copy to clipboard operation
SyliusRedirectPlugin copied to clipboard

[to fix] issue with in internal path

Open Snowbaha opened this issue 4 years ago • 1 comments

Hello,

I noticed I have lot of queries since I installed the plugin whereas I was thinknig it should be only check one time the url to redirect.

image

The issue comes internal paths, at first, I added a condition on : RedirectionPathResolver with someting like

if(false === strpos($source, '/_fragment/')){
//do the stuff
}

but there is lot of sources with this issue ('wishlist' (wishlist bundle) , 'block' / 'section' / 'page' (CMS bundle).

What is the best way to catch the good one to redirect (at home it should be "/") and not all the internal path render wiht controllers?

The best way should be to detect the good request but when I compare the Symfony\Component\HttpFoundation\Request, there is no way to know the good one.

Maybe add a paramter to excludes somes routes?

Snowbaha avatar Nov 16 '21 14:11 Snowbaha

Not sure I completely understand the issue. Could you elaborate a bit or explain a more elaborate example of something unexpected?

loevgaard avatar Mar 16 '23 20:03 loevgaard