× Here you can get community support related to ReDJ.

Change part of URL with /text/ to /this-text/

More
9 years 10 months ago - 9 years 10 months ago #3422 by jvdh
Hello,

I've a lot of URL's with the same pattern like for example /text/ in the URL and those parts needs to be changed to for example /this-text/.

Example URL
Current URL: www.domain.com/text/name-of-page
New URL: www.domain.com/this-text/name-of-page
Or New URL: www.domain.com/this-text/folder/name-of-page

I've tried several things like this but I can't get it right
From URL: ^/text/
To URL: {scheme}://{siteurl}/this-text/{pathltrim /text/}{queryfull}

The new site is in a subfolder called www.domain.com/new/site. Maybe it has something to do with this.
The plugin "Base path" is set to /new/site

Hope you can help me.
Last edit: 9 years 10 months ago by jvdh.

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #3423 by jvdh
If I use the above rules I get the following result:

www.domain.com/new/site/this-text//new/site/text/

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago - 9 years 10 months ago #3424 by admin
Hi,
your first rule is perfect for sites under the web root. Your site is under /new/site so the initial ^/ will never match. To solve the issue I suggest you to put /new/site in the plugin settings (advanced -> base path). This will allow you to preserve rules when the site will be moved on the root folder.

Kind regards,
Luigi
Last edit: 9 years 10 months ago by admin.

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #3425 by jvdh
I already have /new/site in the plugin settings (advanced -> base path)?

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #3426 by admin
If you have the enterprise version, change the macro {pathltrim} with {pathfrombaseltrim}. Otherwise put /new/site in the pathltrim (you are removing from the From but the macros always consider the full URL).
The following user(s) said Thank You: jvdh

Please Log in or Create an account to join the conversation.

More
9 years 10 months ago #3427 by jvdh
Thank you Luigi !

I haven't got the Enterprise version but tried your alternative suggestion and that worked.
I will buy the Enterprise version as thank for your help.

Is the license for the Enterprise version valid for a limited period or is it a lifetime license?

Please Log in or Create an account to join the conversation.

Time to create page: 0.158 seconds