Re: lang in query string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/8/16 Miguel Sánchez de León Peque <msdeleonpeque@xxxxxxxxx>:
> How do Fedora websites change the URL from
>
> fedoraproject.org/?lang=en
>
> to:
>
> fedora project.org/en/
>
> in the browser's displayed URL?
>
>
> Thanks for your help! :-)
> Miguel
>

In apache under /etc/httpd/conf.d/ we have a file that has the
following (I've condensed the languages):

---
AddLanguage ar .ar
AddLanguage as .as
AddLanguage ast .ast

LanguagePriority en
ForceLanguagePriority Prefer Fallback

AddDefaultCharset utf-8

RewriteEngine on


# this is the magic, you are asking about
RewriteCond %{QUERY_STRING} ^lang=(ar|as|ast|more|lang|codes)$
RewriteRule ^(?:/(?:ar|as|ast|more|lang|codes))?(/.*)$ /%1$1? [R=301]
AliasMatch ^(?:/(?:ar|as|ast|more|lang|codes))(/.*)?$
/path/to/fedoraproject.org$1

<Directory /path/to/fedoraproject.org>
  Options MultiViews

  SetEnvIf Request_URI ^/ar/ prefer-language=ar
  SetEnvIf Request_URI ^/as/ prefer-language=as
  SetEnvIf Request_URI ^/ast/ prefer-language=ast
</Directory>
---

Hope this helps.

Sijis
-- 
websites mailing list
websites@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/websites



[Index of Archives]     [Fedora Users]     [Linux ARM]     [ARM Kernel]     [Older Fedora Users]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]

  Powered by Linux