Reputation: 17121
I am working on a multi language file. My urls look something like this:
http://www.example.com/en/about/info
http://www.example.com/nl/about/info
Now I use a small regex script that redirect the user when they use a link without language. The script looks like this:
preg_match('~^/[a-z]{2}/~', $_SERVER['REQUEST_URI'])
This finds out whether there is a language set en|nl|de etc. This works fine on all links except for these:
http://www.example.com/en
http://www.example.com/nl
There is no trailing slash so the regex can not find the given values.
Anyone know a fix for this?
Upvotes: 1
Views: 1961