Re: localization folder for web site

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

 




Stut wrote:
On 14 Sep 2008, at 20:27, Alain R. wrote:
but in this case, my browser address bar will show me : whatever.php?l=en for example. and this is not what i want. I want that browser shows in its address bar /en/whatever, but the page whatever.php will get the parameter l=en.
so how can i do that ?

You're still not getting it, so here it is step by step...

* User request http://yoursite.com/en/index.php

* Apache sees this request, matches the URL to a rewrite rule and *internally* rewrites the request so it looks like http://yoursite.com/index.php?lang=en - note that the browser does not get told anything about this process.

* The index.php script runs, reads $_GET['lang'] to see what language has been requested and generates the page as normal. Whenever it creates a URI it ensures that it's created so it starts with '/'.$_GET['lang'].'/...' to ensure the user continues with the same language.

Hope that makes sense. Now, please Google mod_rewrite, have a play with it on a local test server and try it. If you don't get it from the words, get it from the play!

-Stut

sorry Stut, i maybe miss the point here but i rewrite the rule, however when user request is http://yoursite.com/en/index.php, the browser address bar shows http://yoursite.com/index.php?lang=en :-(
and not only http://yoursite.com/en/index.php

this is my problem :-)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux