× Here you can get community support related to ReDJ.

Breaking up a weird query string

More
10 years 6 months ago #1645 by druth
Breaking up a weird query string was created by druth
I had a bit of a canonical problem that I've already solved, but google has all of these weird links. I want to try to help them find their new home, but this one below is stumping me.

I'm getting a whole bunch of these types of urls:
thescriptlab.com/component/content/article?id=750:the-dreaded-second-draft
thescriptlab.com/component/content/article?id=47:outline-five-elements
etc...

and I want to transform this:
thescriptlab.com/component/content/article?id=750:the-dreaded-second-draft

to this:
thescriptlab.com/750:the-dreaded-second-draft


I currently am using this rule set, but it doesn't see the links.

FROM URL: /component/content/article?id=
TO URL: {scheme}://{siteurl}/{pathltrim /component/content/article?id=}{queryfull}

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

More
10 years 6 months ago #1647 by admin
Replied by admin on topic Breaking up a weird query string
Hi,
there's an error in the from url, you must escape any special char like ?:
FROM URL: /component/content/article\?id=

There's an error also in the destination URL, the pathltrim works only on the path:
TO URL: {scheme}://{siteurl}/{pathltrim /component/content/article}{queryfull}

Kind regards,
Luigi

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

Time to create page: 0.077 seconds