× Here you can get community support related to ReDJ.

problem with pathfrombaseltrim

  • christophe46
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #638 by christophe46
problem with pathfrombaseltrim was created by christophe46
I would like that www.biomattitude.com/u/ is redirected to

www.biomattitude.com/biomwork/index.php/adherents/annuaire-des-adherents/details/2/

I bought RedJ Enterprise as I guess my solution is with pathfrombaseltrim macro :
FromUrl
/u/*$
ToUrl
http://www.biomattitude.com/biomwork/index.php/adherents/annuaire-des-adherents/details/2/{pathfrombaseltrim /u}


but this is not working. I get redirected to www.biomattitude.com/biomwork/index.php/adherents/annuaire-des-adherents/details/2
the last part of the query is missing.

How can I configure this ?

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

  • christophe46
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago - 11 years 3 months ago #639 by christophe46
Replied by christophe46 on topic problem with pathfrombaseltrim
a "static rule"
/u/4$ 	http://www.biomattitude.com/biomwork/index.php/adherents/annuaire-des-adherents/details/2/4 

works

while a "dynamic rule"
 /u/*$ 	http://www.biomattitude.com/biomwork/index.php/adherents/annuaire-des-adherents/details/2/{pathltrim /u}
do not work

I think I'm missing an "obvious" thing in defining my dynamic rule.
Do I need in my case to use pathltrim or pathfrombaseltrim ?
Anyway, I don"t care about the 9€ buying the enterprise version even the community would have been enough, it's not a matter, the extension is fine and price low for the service done. Fair and smart.
My problem is to make it works ;-)
Last edit: 11 years 3 months ago by christophe46. Reason: adding code block for lisibility

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

More
11 years 3 months ago #640 by admin
Replied by admin on topic problem with pathfrombaseltrim
Ok,
so let them work... :)

Try this:
From URL: ^/u/
To URL: http://{siteurl}/biomwork/index.php/adherents/annuaire-des-adherents/details/2/{preg_match 1}/\/u\/([0-9]+)/i{/preg_match}

You have the Enterprise so why not to use preg_match??? Also, after the rule works, just try to change into internale redirect (you can with the Enterprise)....

Please, advise. I have not tested locally.

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

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

  • christophe46
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #643 by christophe46
Replied by christophe46 on topic problem with pathfrombaseltrim
Nice, working.


But with "200 internal redirect", I have a "404 error" problem to fix. If i use an unknown id, I get the internal 404 error page instead of /biomwork as before (I have "ErrorDocument 404 /biomwork/" in .htaccess).

How to say RedJ that 404 is /biomwork and not a local 404 page ? (It's not so important after all).
I'm going to do a french translation of the 404 error page and try to have it assigned to a menu item as I have "templating problem" actually.

www.biomattitude.com/u/3

www.biomattitude.com/u/4

1 rule, 1 redirection ok (4), 1 redirection to internal 404 error page.
Internal redirection is faster than 301 move permanently apparently.


I'm going to keep these settings and try to customise the 404 error page in order to have a better integration with the template. I would like it displayed like an article with the full background. If you have a suggestion on how to have a 404 error page that integrate better with the current template, feel free to suggest me any idea.

For the rest, job nicely done. thanks for your support !

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

More
11 years 3 months ago #646 by admin
Replied by admin on topic problem with pathfrombaseltrim
Uhmmm,
I think is not possible. The reason is the rule matches even the not existing pages, so ReDJ applies for the internal redirect, and in this case the custom error page is not applied. If you try with the 301 redirect instead, it should work.

But you give me a good tip for a new feature to add to the new version.

Kind regards,
Luigi

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

  • christophe46
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #679 by christophe46
Replied by christophe46 on topic problem with pathfrombaseltrim
hello again !

the redirection that was working now only gives 404 error pages

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

Time to create page: 0.086 seconds