Forum Moderators: phranque
www.domain.com/event/content.php?id=1and alternative languages via
www.domain.com/event/content.php?id=1&lang=es
Now the client has asked for me to create other mappings so that
www.domain.com/SPANISHEVENT/content.php?id=1defaults to the spanish version of that event.
One option I have is to link the SPANISHEVENT path to the default and inspect the request uri and set my default language appropriately, but that seems inefficent.
I'd like to know if i can use mod_rewrite (or another tool) to append the lang=? to the querystring, ideally only if a lang=? doesnt already exist in the qs.
Thanks in advance
hbs
The process would be much the same using mod_rewrite: Inspect the URL for "SPANISHEVENT" and if present, then inspect the QUERY_STRING for "lang=xy", and if not present, append "lang=es" to any existing query string.
This could be done with one each of the RewriteRule and RewriteCond %{QUERY_STRING} directives.
However, if you are contemplating having many <COUNTRY>EVENT URLs, and if they will be temporary in nature, then using mod_rewrite might be somewhat of a maintenance nightmare, and I'd suggest an easy-to-administer database-driven approach instead.
Jim