× Here you can get community support related to ReDJ.

Getting a partial URL redirect to work

  • rcyphus
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 10 months ago #5023 by rcyphus
Joomla 3.5
ReDJ 1.7.10

A full URL redirect works (I'm only in a localhost environment currently, not production)
FROM http://localhost/mysitename/forum/user/623-testuser1
TO http://localhost/mysitename/hire/user/viewprofile/623-testuser1
Case sensitive, request only, decode URL all OFF

But a partial URL redirect doesn't - what am I doing wrong?
FROM ^/forum/user/
TO http://localhost/mysitename/hire/user/viewprofile/{userid}-{username}
Case sensitive, request only, decode URL all OFF

I have tried FROM ^/forum/user/{userid}-{username}
I have tried Request only ON
I have tried ON & OFF for case sensitive and decode URL
None of the above work. I have cleared Joomla and Browser caches every time.

Looking forward to any recommendations! Many thanks in advance.

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

More
7 years 10 months ago #5026 by admin
Replied by admin on topic Getting a partial URL redirect to work
The problem in the relative URL is you start the rule with /forum, while it should start with /mysitename. But it is better to leave the rule as is (for portability) and just add this into ReDJ plugin settings (Base Path under Advanced Settings):
/mysitename/

Kind regards,
Luigi

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

  • rcyphus
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 10 months ago #5039 by rcyphus
Replied by rcyphus on topic Getting a partial URL redirect to work
Many thanks for the response Luigi. I must be a slow learner or was missing something fundamental!

I tried multiple options and then revisited your documentation and finally got the below to work perfectly.

^/mysitename/forum/user/
{scheme}://{siteurl}/hire/user/viewprofile/{pathltrim /mysitename/forum/user/}

I'm guessing (will find out when I move to production) that the localhost complicated matters and that in production I will remove /mysitename from both the FROM and pathltrim macro in the TO field?

Many thanks for such an awesome product.

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

More
7 years 10 months ago #5042 by admin
Replied by admin on topic Getting a partial URL redirect to work
Yes,
just remove the /mysitename part from source and destination and the rule will work also in production. There are many other options you have to avoid this. One really simple is to use a virtual host for your apache (instead of localhost) adding something like this into hosts file:
127.0.0.1   localhost dev.mysite.com

So you can call your site as:

dev.mysite.com/forum/user

Instead of:

http://localhost/mysitename/forum/user

Another option, as i told you, is to use the "base path" option in the plugin settings. And remove it in production, when is not needed anymore.

Kind regards,
Luigi
The following user(s) said Thank You: rcyphus

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

Time to create page: 0.088 seconds