I want to pick up the ISO code (two letters) of a country using a REGEX expression
For example, for the country Ireland the ISO code is ie. The ISO code could be found after the slash / or after the last .
This is my RewriteRule:
RewriteRule ^gallery/country(?:/[^/]*([a-zA-Z-9]{2}))?/?$ gallery/gallery.php?country=$1 [L,QSA]
Here are some valid url's... If available, I want to pick the ISO Code:
gallery/country
gallery/country/
gallery/country/ie
gallery/country/ie/
gallery/country/ireland
gallery/country/ireland/
gallery/country/ireland-love.ie
gallery/country/ireland-love.ie/
gallery/country/ireland.69-love.ie/
I've try to adapt the template formula that I use pretty much for all of my seo url's, but i'm having difficulties with this one. Here's what I've done so far.
^gallery/country(?:/[^/]*([a-zA-Z-9]{2}))?/?$