upper case redirect not working
-
bonaventure
-
Topic Author
-
Offline
-
Junior Member
-
Less
More
-
Posts: 33
-
Thank you received: 0
-
-
10 years 9 months ago #2625
by bonaventure
My from and to URL's are as follows (thanks to Luigi for helping me configure everything):
From URL: ^/[0-9A-Za-z]{4}$
To URL: http://{siteurl}/horses/${id}-${alias}
"Case sensitive" is not checked, so it shouldn't matter if the alias is mysite.com/aaaa or mysite.com/AAAA.
However, it throws an error when I use upper case. Is there a way to convert them to lower case on the fly or do I need to change the expression above?
I also have placeholders that grab the id, so I'm not sure if there is a conflict with the lowercase alias in the database and the uppercase alias in the referring URL.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
10 years 9 months ago #2627
by admin
Hi,
the case sensitive allows you to match both /aaaa and /AAAA. The problem is when you take this key to search in the database where there's only aaaa. So we need to put the key in lowercase before to search. Change placeholders like the following:
p={pathltrim /}
alias={lowercase}${p}{/lowercase}
id={tableselect #__content,id,alias}${alias}{/tableselect}
After this all should work properly.
Kind regards,
Luigi
The following user(s) said Thank You: bonaventure
Please Log in or Create an account to join the conversation.
-
bonaventure
-
Topic Author
-
Offline
-
Junior Member
-
Less
More
-
Posts: 33
-
Thank you received: 0
-
-
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.123 seconds