Replacing "/item/1234-"
-
kalixo
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 45
-
Thank you received: 0
-
-
8 years 5 months ago #5002
by kalixo
Dear all,
I need to redirect from:
website.com/item/XXXX-urlname
to:
website.com/urlname
So, I need to remove "/item/XXXX-" from my urls. Those "XXXX" are always four numbers, and "-" is always "-".
"Ulrname" sometimes can start with number(s).
Thansk is advance,
best regards,
Kalixo.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
8 years 5 months ago #5005
by admin
Try this:
From URL: ^/item/[0-9]+-
To URL: {scheme}://{siteurl}{preg_match 1}/[0-9]+-(.*)$/{/preg_match}
Request only: true (checked)
Please Log in or Create an account to join the conversation.
-
kalixo
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 45
-
Thank you received: 0
-
-
8 years 5 months ago #5008
by kalixo
Dear Admn
Thank you for solution, but It doesn't work propperly - now I got address:
website.comurlname (so it removes also "/").
Could you please correct this problem?
Thansk,
Kalixo
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
8 years 5 months ago #5014
by admin
It's easy, you should try by yourself:
From URL: ^/item/[0-9]+-
To URL: {scheme}://{siteurl}/{preg_match 1}/[0-9]+-(.*)$/{/preg_match}
Request only: true (checked)
Please Log in or Create an account to join the conversation.
-
kalixo
-
Topic Author
-
Offline
-
Senior Member
-
Less
More
-
Posts: 45
-
Thank you received: 0
-
-
8 years 5 months ago - 8 years 5 months ago #5016
by kalixo
Dear Admin,
thank you, everything works just great!
BIG THANKS!
Last edit: 8 years 5 months ago by kalixo.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.138 seconds