Redirect to Menu Item
-
icandywebs
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
-
-
8 years 3 months ago #5251
by icandywebs
Hi,
I have several non-SEF url's that I am trying to attempt to redirect with 1 rule if possible. All of the From Urls look like the attached image I've uploaded. I would like to redirect them to existing SEF url's that I have created.
The To Url's all start with the relative path:
procedures/
However since some menu items are nested, not all procedures have the same relative path after procedures/. Hopefully, I am making sense. Is there a way to possible set the To Url to query the article id and get the SEF URL that I have set in the menu item? Thanks for any help you can provide and for creating such an amazing and flexible extension.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
8 years 3 months ago #5535
by admin
Hi,
cannot say because the image contains the non-SEF URLs that should be redirected to the SEF version. Consider that they can be managed by a single rule only under 2 conditions, 1) if the From URL part of the rule (a regular expression) can match them all, and it seems possible, and 2) if all the destionations are similar and can be expressed with a single URL with some placeholders.
So in your case I miss the targets to figure out if both conditions are true. You shoud build a short list of couples (old->new) so I can figure out if what you want is doable with one or few rules.
If you don't want to post the list, send me a PM at info(at)selfget.com.
Kind regards,
Luigi
Please Log in or Create an account to join the conversation.
-
icandywebs
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
-
-
8 years 3 months ago #5537
by icandywebs
Hi,
Thanks so much for your help here's an example of the relative paths for each non SEF url.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
8 years 3 months ago #5544
by admin
Create a rule as follow:
From URL: ^/procedures/
To URL: {scheme}://{siteurl}/component/content/article?id={id}:{slug}
Request only: true (checked)
Placeholders:
slug={preg_match 1}/\/([^\/]+)$/i{/preg_match}
id={tableselect #__content,id,alias}${slug}{/tableselect}
I haven't tested it, so let me know if it works.
Kind regards,
Luigi
Please Log in or Create an account to join the conversation.
-
icandywebs
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 3
-
Thank you received: 0
-
-
-
-
8 years 3 months ago #5547
by icandywebs
Hi,
The first column is the To URL and the second column is the From URL. My apologies for not clarifying. So I don't think this suggestion will work
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
8 years 3 months ago - 8 years 3 months ago #5548
by admin
The opposite is not so easy as it could seems. The reason is that some target has only one level after procedures, while other has two (example, pelvic-congestion-syndrome => interventional/pelvic-congestion-syndrome).
So you should check if in your content table or menu table, the content id=33 has this as slug or something:
interventional/pelvic-congestion-syndrome
So we can think to build it with a lookup table. The only inputs we have to build the destination are 33 and pelvic-congestion-syndrome.
Kind regards,
Luigi
Last edit: 8 years 3 months ago by admin.
Please Log in or Create an account to join the conversation.
Time to create page: 0.137 seconds