Forum Moderators: phranque
I have the following problem. Rewriterule:
RewriteRule
^([A-Za-z\ ]*)-
([A-Za-z\ ]*)-
([A-Za-z\ ]*)-
([A-Za-z\ ]*)-
(best) ./display_all_category_list_city.php?group=city&catname=$1&idbycity=$4&type=$5
This works for this url:
http://www.example.com/Var1-Var2-Var3-Var4-best
But doesn't work with this sort of url's:
http://www.example.com/Var1-Var-2-Var3-Var4-best
http://www.example.com/Var1-Var2-Var-3-Var4-best
http://www.example.com/Var1-Var2-Var3-Var-4-best
What do I need to change on the rewriterule to get the url's with a hyphen inside a variable also correctly be displayed?
I have the same issue with special characters.
What do I need to change on the rewriterule to get the url's with a special characters inside a variable also correctly be displayed?
Thanks a lot in advance for your reply!
greetings,
Martijn
Jim
RewriteRule ^(provincie)-([A-Za-z0-9\x00-\x7f\ ]*)$ _links_province.php?grp_name=$1&cat_name=$2
RewriteRule ^(provincie)-([A-Za-z0-9\x00-\x7f\ ]*)-of-([A-Za-z0-9\x00-\x7f\ ]*)$ _links_province.php?grp_name=$1&cat_name=$2&country=$3
RewriteRule ^(provincie)-([A-Za-z0-9\x00-\x7f\ ]*)-n([0-9])$ _links_province.php?grp_name=$1&cat_name=$2&next=$3
RewriteRule ^(provincie)-([A-Za-z0-9\x00-\x7f\ ]*)-p([0-9])$ _links_province.php?grp_name=$1&cat_name=$2&prev=$3
RewriteRule ^(plaats)-([A-Za-z0-9\x00-\x7f\ ]*)$ _links_city.php?grp_name=$1&cat_name=$2
RewriteRule ^(plaats)-([A-Za-z0-9\x00-\x7f\ ]*)-([A-Za-z0-9\x00-\x7f\ ]*)-n([0-9])$ _links_city.php?grp_name=$3&cat_name=$2&next=$4
RewriteRule ^(plaats)-([A-Za-z0-9\x00-\x7f\ ]*)-([A-Za-z0-9\x00-\x7f\ ]*)-p([0-9])$ _links_city.php?grp_name=$3&cat_name=$2&prev=$4
These rules work great for almost all my url's. Except for url's with strange characters like: Løkken-informatie
The rewriterule is used in the code with utf8_decode($_GET['cat_name']);
This works fine for almost all codes, except for the urls with a ø like Løkken-informatie
Does anybody have a solution fot this please?
Thanks in advance for your reply!
Greetings,
Martijn