× Here you can get community support related to ReDJ.

redirect with a part of url !

  • strouve181
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago #4781 by strouve181
Replied by strouve181 on topic redirect with a part of url !
Yes it's enteprise edition.

i try it, but i don't have the correct return :
i have this :
www.pets-easy.fr/autocollants-ronds-personnalises-.html

and i must have the same but with the "coucou"
www.pets-easy.fr/autocollants-ronds-personnalises-coucou.html

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

More
8 years 8 months ago #4782 by admin
Replied by admin on topic redirect with a part of url !
Sorry, but I don't understand. If I call:

www.pets-easy.com/boutique/autocolants-coucou-detail

I get redirected to:

www.pets-easy.fr/autocollants-ronds-personnalises-coucou.html

And this is exactly what you asked me. But the destination is a 404 error page.

Are you sure you provided me the right URLs? Consider that the destination MUST exists....

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

  • strouve181
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago #4783 by strouve181
Replied by strouve181 on topic redirect with a part of url !
Hello,

Yes exactly, coucou is not valid, it's the sample. I just test in another navigator and all is ok, i think the history of navigator put some trouble.

Just one thing, why you put a . before the * in that section : (.*)

freindly

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

More
8 years 8 months ago #4784 by admin
Replied by admin on topic redirect with a part of url !
Yes, clear browser cache.

A dot means "any char", so group (.*) means "any char, from 0 to N times". You can replace the star * with a plus + so to have "any char, from 1 to N times"
The following user(s) said Thank You: strouve181

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

  • strouve181
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago #4785 by strouve181
Replied by strouve181 on topic redirect with a part of url !
and if i put another path, it's the same ?

^/boutique/autocollant-et-adhesif/autocollant-.*-detail$

www.pets-easy.fr/autocollants-ronds-personnalises-{preg_match 1}/autocolants-(.*)-detail/i{/preg_match}.html

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

More
8 years 8 months ago #4786 by admin
Replied by admin on topic redirect with a part of url !
A rule is applied only when the FROM URL matches, and your FROM URL is:

^/boutique/autocolants-.*-detail$

That means "start with" (^) /boutique/autocolants- then 0 to N chars, and then -detail and then ends ($)

The destination is build using a preg_match macro that extracts the word in the middle.

I hope now is clear how the rule works...

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

Time to create page: 0.207 seconds