Need help with this redirect
-
darkhoros
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 77
-
Thank you received: 0
-
-
7 years 10 months ago #5872
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
-
Less
More
-
Posts: 77
-
Thank you received: 0
-
-
7 years 10 months ago #5874
by darkhoros
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
7 years 10 months ago #5878
by admin
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.136 seconds