Re: localization folder for web site

From: Date: Mon, 15 Sep 2008 17:29:24 +0000
Subject: Re: localization folder for web site
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-280202@lists.php.net to get a copy of this message
let's take an example. 1. user types in his favorite browser www.website.com 2. www.website.com/index.php redirects user to www.website.com/en/welcome/ (index.php within /welcome) thanks the following command: header("Location: http://www.website.com/en/welcome/"); 3. however, as /en/welcome does not exist, apache sends an error message: The requested URL /se_internet/en/welcome/ was not found on this server.
What's this "se_internet"? It looks to me that you've got a DOCUMENT_ROOT problem. se_internet is simple the physical folder in which my files and therefore website is/are.
even if i have in my .htaccess file: RewriteRule ^/([A-Za-z0-9-]+)/welcome/$ /welcome/index.php?lang=$1 [NC,L]
What comes before this line? If all you should have is a 2-letter language code, you should use: ^([a-z]{2})/welcome or, if you want to ensure only certain language codes are used: ^([de|fr|en])/welcome (for example) this is very interesting. i try it
4. user should at the end have in his browser address bar http://www.website.com/en/welcome but apache would reroute user to www.website.com/welcome/index.php?lang=en so where is the problem ? is there a problem with RewriteRule when you reroute only virtual folders ?
I think you need to post your entire rewrite rules.
so here it is: Options +FollowSymlinks RewriteEngine on RewriteBase /se_internet/ RewriteRule ^([de|fr|en])/welcome/$ welcome/index.php?lang=$1 [NC,L]

« previous php.general (#280202) next »