× Here you can get community support related to ReDJ.

Redirect url ending with a das- at the end

  • javierv@ocioimagen.com
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #1942 by javierv@ocioimagen.com
Redirect url ending with a das- at the end was created by javierv@ocioimagen.com
Hello,

(I'm a little embarrassed. Will understand that maybe you can not answer by using your forum too).


I have noticed that I have multiple urls ending with a dash at the end of the alias:

mysite.com/category1/subcategory/thi-is-my-alias-/


That's Directly to 404 errors.

I have tried using various solutions to other problems in the forum without success.

Can you help again?

(otherwise, you could recommend a good practical book on regular expressions? Will you help me take advantage Redj)

Thanks. Sorry.

Alx.

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

  • javierv@ocioimagen.com
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #1943 by javierv@ocioimagen.com
Replied by javierv@ocioimagen.com on topic Redirect url ending with a das- at the end
Sorry, the question is How can redirect:

mysite.com/category1/subcategory/thi-is-my-alias-/ (bad)

to

mysite.com/category1/subcategory/thi-is-my-alias/ (Good)

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

More
10 years 4 months ago - 10 years 4 months ago #1946 by admin
Replied by admin on topic Redirect url ending with a das- at the end
Ok,
try this:
From URL: ^/category1/subcategory/[^-]+-/$
To URL: http://{siteurl}/category1/subcategory/${a}/
Request only: true (checked)
Placeholders: a={preg_match 1}/\/category1\/subcategory\/([^-]+)-\/$/i{/preg_match}

About the regexp here is the link (as indicated in the manual):

dev.mysql.com/doc/refman/5.1/en/regexp.html

Kind regards,
Luigi
Last edit: 10 years 4 months ago by admin.

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

  • javierv@ocioimagen.com
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #1951 by javierv@ocioimagen.com
Replied by javierv@ocioimagen.com on topic Redirect url ending with a das- at the end
Hi,

I´m sorry but the code isn't working. The url redirect to the same and not erase "-".

Thanks.

Alx

(Thanks for the link, yes, I try to study it and the Cheat Sheet, but I thought I need something more "newbie". Maybe I can give it a second opportunity)

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

More
10 years 4 months ago #1955 by admin
Replied by admin on topic Redirect url ending with a das- at the end
Probably is not redirecting at all (otherwise you should get a loop). Pls, send me a PM at info(at)selfget.com with an example URL, I need to check.

Kind regards,
Luigi
The following user(s) said Thank You: javierv@ocioimagen.com

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

  • javierv@ocioimagen.com
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago #1958 by javierv@ocioimagen.com
Replied by javierv@ocioimagen.com on topic Redirect url ending with a das- at the end
OK.Thank you very much, I just sent you it.

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

Time to create page: 0.135 seconds