A challenging redirect
-
gyomtov
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
11 years 9 months ago #727
by gyomtov
Hi there,
Great support forum, but I was not able to find a solution to my problem.
I have the enterprise version, which I bought to solve the following issue:
URL:
ringtones/country/jason-aldean/wheels-rollin-lyrics.html
Redirect to:
wheels-rollin-lyrics.html
URL:
ringtones/blues/allman-brothers-band/god-rest-his-soul-lyrics.html
Redirect to:
god-rest-his-soul-lyrics.html
and so on... ( I have thousands of links like that...)
The issue is that I need 3 "/" in order to perform the redirect.
For URLs like:
ringtones/country/jason-aldean.html - I don't want to make the redirect. (2 "/" only)
Can you help getting that done?
Thanks!
Guy.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
11 years 9 months ago #729
by admin
Just a question before,
you need a rule for each URL or yuou would like to build a single rule that do all redirections?
We can probably follow the second solution, but I need to understand how to build a regular expression that matches ALL source pages (URL to redirect).
As example, lookin at posted URLs, I could intercept ALL URLs starting with /ringtones/, and followed by other two /, then redirect to the /final-part.html, but this rule wil match ANY /ringtones/something/something/final-part.html.
If this is what you need, then we can proceed ...
From URL: ^/ringtones/[^/]+/[^/]+/[^/]+\.html$
To URL: http://{siteurl}/{preg_match 1}/\/ringtones\/[^\/]+\/[^\/]+\/(.*)/{/preg_match}
Kind regards,
Luigi
The following user(s) said Thank You: marcel555, gyomtov
Please Log in or Create an account to join the conversation.
-
gyomtov
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 2
-
Thank you received: 0
-
-
11 years 9 months ago #730
by gyomtov
This is exactly what I needed.
Amazing.
THANKS!
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.150 seconds