× Here you can get community support related to ReDJ.

Need help with this redirect

  • darkhoros
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 3 months ago #5872 by darkhoros
Need help with this redirect was created by darkhoros
Hi,
Need to redirect this url
http://{siteurl}/--/some-text-is-here
to this url
http://{siteurl}/index.php/component/joomd/real-estate-egypt/newsearchresults?searchtxtbox=${b}&Itemid=509
where ${b}= some text is here
Notice I have replaced the hyphen with space

Here is what I did
From Url: ^/--/[a-zA-Z0-8-]
to url : http://{siteurl}/index.php/component/joomd/real-estate-egypt/newsearchresults?searchtxtbox=${b}&Itemid=509

Request only box is checked

Place holder as follows
p={path}
c={preg_subject 2,${p}}/--/([a-zA-Z0-8\-]+)/i{/preg_subject}
b={str_replace '-',' '}${c}{/str_replace}

But I cant get it to work, where is the wrong part.
Thank you for your help.
Regards.

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

  • darkhoros
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 3 months ago #5874 by darkhoros
Replied by darkhoros on topic Need help with this redirect
ok,
Get it to work, using the following placeholders

p={path}
c={preg_subject 2,${p}}/\/(--)\/([\w-]+)/i{/preg_subject}
b={str_replace '-',' '}${c}{/str_replace}

used this website to build my query
regex101.com/

hope this help some one.

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

More
7 years 3 months ago #5878 by admin
Replied by admin on topic Need help with this redirect
Sorry for delay, but let me tell you that you know how to use macros and placeholders better than me :)

Kind regards,
Luigi

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

Time to create page: 0.088 seconds