× Here you can get community support related to ReDJ.

Need help with redirect parameters

  • junpaglin
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 5 months ago #5690 by junpaglin
Need help with redirect parameters was created by junpaglin
Just downloaded and installed the ReDJ Enterprise version. I really need assistance as I have tried the various format described in the forum as well as in the documentation but I can't seem to get it to work. We have several message series in our website that is accessed via a URL similar to this:

www.victoryfort.org/index.php/series-details?seriesid=113

The URL for the other message series will be consistent with the format above except for the series id number at the end which will change depending on its series ID. Our goal is to give our client's a shorter version of this URL so it is easy to remember, similar to:

www.victoryfort.org/truthbetold

In short, when visitor types in www.victoryfort.org/truthbetold it should take them to the page www.victoryfort.org/index.php/series-details?seriesid=113

So how should I set up the FROM & TO as well as other parameters in the ReDJ component? I also attached a screenshot of both my component and plugin pages.

Hoping for your assistance.
Attachments:

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

More
7 years 5 months ago #5693 by admin
Replied by admin on topic Need help with redirect parameters
Hi,
first I checked your URLs and the target www.victoryfort.org/truthbetold is not existing (404). So I will assume that you want to create it using ReDJ. You already bought the Enterprise version so we can create a rule with a 200 Internal redirect. But the rule should include a query lookup because I need to "trasform" the "truthbetold" into "113" and this information is not available in the source URL. So I guess you have a table with both information (e.g. the content table). Please check it and let me know, and we will build the rule you need. If you prefer, you can send me these information via email at info(at)selfget.com.

The rule will be something like:
From URL: ^/<something>/
To URL: {scheme}://{siteurl}/index.php/series-details?seriesid={id}
Request only: true (checked)
Redirect type: 200 (internal)
Placeholders:
slug={preg_match 1}/\/something\/([^\/]+)$/i{/preg_match}
id={tableselect #__content,id,alias}${slug}{/tableselect}

As you can see we will match any URL in the "pool" under /<something>/ and will redirect it (internally, onserver side) to the existing page, looking up the id from the table, using the "slug" as key. The problem is you need to add the folder <something> to your URLs, or I cannot create a rule to match the pool. Without the <something> folder, any URL will match the rule, even the one you already have and you don't need to redirect (i.e. /news, /contact, and so on). But you could use any meaningful <something> like /series.

Looking forward for your reply.

Thanks,
Luigi

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

Time to create page: 0.074 seconds