Redirect url ending with a das- at the end
-
javierv@ocioimagen.com
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 14
-
Thank you received: 0
-
-
10 years 11 months ago #1942
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
-
Less
More
-
Posts: 14
-
Thank you received: 0
-
-
10 years 11 months ago #1943
by javierv@ocioimagen.com
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 11 months ago - 10 years 11 months ago #1946
by admin
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 11 months ago by admin.
Please Log in or Create an account to join the conversation.
-
javierv@ocioimagen.com
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 14
-
Thank you received: 0
-
-
10 years 11 months ago #1951
by javierv@ocioimagen.com
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 11 months ago #1955
by admin
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
-
Less
More
-
Posts: 14
-
Thank you received: 0
-
-
10 years 11 months ago #1958
by javierv@ocioimagen.com
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.168 seconds