 |
Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc Comunitatea PHP Romania
|
| Subiectul anterior :: Subiectul următor |
| Autor |
Mesaj |
gablagost
Data înscrierii: 08/Ian/2007
Mesaje: 20
Locație: Iasi
|
| Trimis: Lun Feb 05, 2007 7:22 pm Titlul subiectului: .htaccess -redirect multilanguage |
|
|
salut
sa va prezint datele problemei:
am apache-ul instalat pe c:
htdocs-ul este pe D:\ (d:\htdcos)
siteul la care lucrez trebuie sa fie multilanguage (se afla in "d:\htdocs\site\htdocs")
daca vin by default pe: http://localhost/site/htdocs, trebuie sa ma trimita pe http://localhost/site/htdocs/de
daca doresc sa intru din url in http://localhost/site/htdocs/modul, vreau sa ma redirecteze in http://localhost/site/htdocs/de/modul
am urmatorul .htaccess in d:\htdocs\site\htdocs
Citat:
RewriteEngine On
RewriteBase /site/htdocs/
# If we have the language in the URL then set the appropriate env variable
RewriteRule ^(de|en)/(.+)\.php $2.php [E=LANGUAGE:$1,L]
RewriteRule ^(de|en)/(.+)/$ $2/index.php [E=LANGUAGE:$1,L]
RewriteRule ^(de|en)/$ index.php [E=LANGUAGE:$1,L]
# If we don't have a language selected then choose DE as default language
RewriteCond %{ENV:LANGUAGE}%{ENV:REDIRECT_LANGUAGE} !(de|en)
# Rewrite links of type /sortiment/ into /de/sortiment/
RewriteRule ^(de|en){0,0}(.+)/$ de/$0 [R=301]
# By default go to German
RewriteRule ^$ de/$1 [R=301]
cand scriu in url: http://localhost/site/htdocs/modul nu imi schimba url-ul in http://localhost/site/htdocs/de/modul
idee unde gresesc?
multumesc anticipat |
|
| Sus |
|
PHPRomania Bot
Bot Member
Data înscrierii: 27/Dec/2007
Mesaje: 1
Locaţie: Server Google |
| Trimis: Mie Dec 26, 2007 7:01 pm Titlul subiectului: Ad |
|
|
|
|
|
| Sus |
|
| |
|