× Here you can get community support related to ReDJ.

Is there other code to use instead of "It must specify an absolute URL"

More
6 years 5 months ago - 6 years 5 months ago #6405 by rowby
Hi

I am working on a development site where the URL will change once we make it live.

For the destination url, instead of putting the absolute URL, is there a macro or placeholder we can use. All of the redirects are going to the same url -- no remote urls. We just don't want to put in the temporary url because once we move the development site to the final domain it won't work.

Can you give me/us a generic placeholder or macro to replace, for example www.google.com/whatever with just a placeholder so all would need to type in would be something like "{placeholder}/whatever" (The forum is stripping out the https:// in the above url -- so the placeholder would of course need to include https://)

From the documentation:
The field "To URL" must contains the destination URL where to redirect the web browser for any requested URL that matches with the current rule. It must specify an absolute URL, starting with the "scheme" part. The "To URL" field can contains macros and placeholders to build the destination dynamically. Each macro or placeholder is evaluated after an URL matches, and its value is replaced to the macro or placeholder itself. Support of regular expressions, macros and placeholders allow to build complex URL trasformations.
Last edit: 6 years 5 months ago by rowby.

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

More
6 years 5 months ago #6410 by admin
Hi Rowby,
the destination URL should be always build like:
To URL: {scheme}://{siteurl}/...

Where {scheme} preserves the current request scheme (http or https), and {siteurl} is the domain. In case your test site is under a folder (i.e. yoursite.localhost/testme)and the live site is on the root domain, you should add the folder (/testme) in the plugin settings (advanced -> base path), and ignore it when you build your redirection rules. WHen you go live, just remove this setting and the rule still work the same on the live site.

I hope it is clear now.

Kind regards,
Luigi

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

Time to create page: 0.104 seconds