[opencms-dev] OpenCms 11.0.2: using rewrite rules in alias feature

Schliemann, Kai K.Schliemann at comundus.com
Sun May 23 15:12:45 CEST 2021


Hello Georg,

thanks a lot. We will give it a try.
Best regards
Kai

Von: opencms-dev <opencms-dev-bounces at opencms.org> Im Auftrag von Georg Westenberger
Gesendet: Freitag, 21. Mai 2021 17:35
An: opencms-dev at opencms.org
Betreff: Re: [opencms-dev] OpenCms 11.0.2: using rewrite rules in alias feature

Hello,



A:
{  1 }{                     2                           }{    3                }{    4     }{                                            5                                       }
/de/Afolderpart1- Afolderpart2/productname/productid/someoldnamewhichisnolongerneeded.html

Will have the new structure

B:
{ 1   }{         2                   }{       4        }{                 3            }
/de/Bfolder1/Bfolder2/productid/productname.html

That means:
1 stays the same in A and B
2 will change from one folder to two folders. Folder in A has always the same name. Folder 1 and 2 in B will always be the same name. --> one folder in A will be replaced by two folders in be. They stay the same for all products.
3 in A will change position 4 in B
4 in A will change position 3 in B. 3 is dynamic but the same in A and B. Except, that in B ".html" is added
5 from A will no longer exist in B

productid is always five numbers (12345)

So can anyone tell, if such a scenario is possible with the about mentioned feature?
I know, that this could be handled with Apache but we would like to manage all redirects in OpenCms.

This should work, as long as the /de is an actual folder and is not generated by the OpenCms "single tree" localization mechanism:

Pattern: /de/(.+?)-(.+?)/(.+?)/(.+?)/[^/]+\.html

Replacement: /de/$1/$2/$4/$3.html

I'm not sure if it's possible when you're using the "single tree" localization. It might work without the /de, but I haven't tried.



Regards,

Georg Westenberger



--



Alkacon Software GmbH & Co. KG - The OpenCms Experts

Georg Westenberger

An der Wachsfabrik 13

50996 Koeln, DE



Email: g.westenberger at alkacon.com<mailto:g.westenberger at alkacon.com>



http://www.alkacon.com

http://www.opencms.org



Amtsgericht Köln, HRA 32185, USt-IdNr.: DE259882372

Vertreten durch: Alkacon Verwaltungs GmbH

Geschäftsführer: Alexander Kandzior, Amtsgericht Köln, HRB 88218
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.opencms.org/pipermail/opencms-dev/attachments/20210523/6c7f9fe2/attachment.htm>


More information about the opencms-dev mailing list