Problem using RegEx
-
bettabi
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
10 years 8 months ago #2236
by bettabi
Hi!
I would like to set a canonical url using regular expression (but I can't figure it out):
I've tried to set /blog/*$ in url and /attivita/*$ in canonical (see image) but it's not working.
For example, no canonical url in this link:
www.skipperclub.it/it/blog/1-maggio-vela-a-capraia.html
Can you help me with this issue?
Thank you!
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
-
bettabi
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
10 years 8 months ago #2238
by bettabi
Yes you're right!
Can you kindly tell me how can I get what I want - if it's possible?
Thank you!
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 8 months ago - 10 years 8 months ago #2241
by admin
Just set canonical filed as:
http://{siteurl}/${lang}/attivita/${subpath}
And add this to placeholders:
lang={preg_match 1}/^.*\/([^\/]+)\/blog\//i{/preg_match}
subpath={preg_match 1}/\/blog\/(.*\.html)/i{/preg_match}
Not tested, so not sure it works at first try...
Kind regards,
Luigi
Last edit: 10 years 8 months ago by admin.
Please Log in or Create an account to join the conversation.
-
bettabi
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
-
bettabi
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
Time to create page: 0.139 seconds