|
|
|
|
||||||
| alt.apache.configuration Apache web server configuration issues. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I would like to use this option for my website but it doesn't work. So have activated this modules LoadModule rewrite_module modules/mod_rewrite.so AddModule mod_rewrite.c And my .htaccess php_flag register_globals 1 Options +FollowSymlinks RewriteEngine On RewriteRule ^$ /HomePage [L,PT] RewriteRule ^/index\.php?lang=1$ /fr [L,PT] RewriteRule ^/index\.php?lang=0$ /en [L,PT] RewriteRule ^/index\.php?lang=1&var1=plan$ /fr/plan [L,PT] Nothing works ![]() What is my pb ????? So if you have any ideas, please, give me your opinion bye |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"Tschuß" <fleguen@gmail.com> schreef in bericht
news:c8c520d0-386f-490d-b2f0-82a2a03c26c6@p69g2000hsa.googlegroups.com... > So have activated this modules > LoadModule rewrite_module modules/mod_rewrite.so > AddModule mod_rewrite.c > > And my .htaccess > php_flag register_globals 1 > Options +FollowSymlinks > RewriteEngine On > RewriteRule ^$ /HomePage [L,PT] > RewriteRule ^/index\.php?lang=1$ /fr [L,PT] > RewriteRule ^/index\.php?lang=0$ /en [L,PT] > RewriteRule ^/index\.php?lang=1&var1=plan$ /fr/plan [L,PT] > > Nothing works ![]() > IIRC in .htaccess omit the leading / You need a condition to test each part of the querystring RewriteCond %{QUERY_STRING} lang=1 RewriteCond %{QUERY_STRING} var1=([^&]+) RewriteRule ^index\.php$ /fr/%1 [L,PT] RewriteCond %{QUERY_STRING} lang=1 RewriteRule ^index\.php$ /fr [L,PT] RewriteCond %{QUERY_STRING} lang=0 RewriteCond %{QUERY_STRING} var1=([^&]+) RewriteRule ^index\.php$ /en/%1 [L,PT] RewriteCond %{QUERY_STRING} lang=0 RewriteRule ^index\.php$ /en [L,PT] If the list of language numbers grows large, consider a rewritemap -in server config rather than .htaccess- Some pitfalls ahead, not quite sure what you are after too HansH |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> IIRC in .htaccess omit the leading /
What that means ? IIRC ???? > You need a condition to test each part of the querystring > RewriteCond %{QUERY_STRING} lang=1 > RewriteCond %{QUERY_STRING} var1=([^&]+) > RewriteRule ^index\.php$ /fr/%1 [L,PT] > > RewriteCond %{QUERY_STRING} lang=1 > RewriteRule ^index\.php$ /fr [L,PT] > > RewriteCond %{QUERY_STRING} lang=0 > RewriteCond %{QUERY_STRING} var1=([^&]+) > RewriteRule ^index\.php$ /en/%1 [L,PT] > > RewriteCond %{QUERY_STRING} lang=0 > RewriteRule ^index\.php$ /en [L,PT] > > If the list of language numbers grows large, consider > a rewritemap -in server config rather than .htaccess- > > Some pitfalls ahead, not quite sure what you are after too > > HansH I try what you have said but it doesn't work. Do you have any web adress to have more details about RewriteRule ? |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Sun, 20 Jan 2008 10:12:50 -0800 (PST), "Tschuß"
<fleguen@gmail.com> wrote: >What that means ? IIRC ???? If I Recall Correctly (= if my memory serves me well) -- ( Kees ) c[_] Seen on a sign in a mechanic's garage: Labor $10.00/hr. If you watch $15.00/hr. If you $25.00/hr. (#524) |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
"Tschuß" <fleguen@gmail.com> schreef in bericht
news:e00a850b-db56-476a-b526-e88e28722a98@v67g2000hse.googlegroups.com... >> ... not quite sure what you are after too > > I try what you have said but it doesn't work. Explain your needs in english,. > Do you have any web adress to have more details about RewriteRule ? http://httpd.apache.org/docs/2.2/misc/rewriteguide.html HansH |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Jan 20, 8:19 pm, "HansH" <ha...@invalid.invalid> wrote:
> "Tschuß" <fleg...@gmail.com> schreef in berichtnews:e00a850b-db56-476a-b526-e88e28722a98@v67g2000hse.googlegroups.com...>> ... not quite sure what you are after too > > > I try what you have said but it doesn't work. > > Explain your needs in English,. > Ok, I have created this website www.excel-exercice.com For each item, I have 2 parameters, the language (0 or 1) and the criteria for the item (1-1-1 ; 3-2-1 ; ......) So, when you select one item, you have for instance the following URL http://www.excel-exercice.com/index....g=0&var1=2-1-1 and I would like to have something like http://www.excel-exercice.com/border-and-pattern..html I have 155 items for the French language and 46 in English but it doesn't disturb me to write as many URL in my .htaccess as necessary. Does these explanations are enough or you need further info ? |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
"Tschuß" <fleguen@gmail.com> schreef in bericht
news:0ec084ff-3ddb-41a6-a946-c6ad931948ae@h11g2000prf.googlegroups.com... > On Jan 20, 8:19 pm, "HansH" <ha...@invalid.invalid> wrote: > I have created this website www.excel-exercice.com > For each item, I have 2 parameters, the language (0 or 1) and the > criteria for the item (1-1-1 ; 3-2-1 ; ......) > > So, when you select one item, you have for instance the following URL > http://www.excel-exercice.com/index....g=0&var1=2-1-1 > and I would like to have something like > http://www.excel-exercice.com/border-and-pattern.html Given http://www.excel-exercice.com/en/7-1-1.html is not working I take it you want it to show like http://www.excel-exercice.com/index....g=0&var1=7-1-1 Am i right or wrong? HansH |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Sun, 20 Jan 2008 12:33:24 -0800 (PST), "Tschuß"
<fleguen@gmail.com> wrote: >On Jan 20, 8:19 pm, "HansH" <ha...@invalid.invalid> wrote: >> "Tschuß" <fleg...@gmail.com> schreef in berichtnews:e00a850b-db56-476a-b526-e88e28722a98@v67g2000hse.googlegroups.com...>> ... not quite sure what you are after too >> >> > I try what you have said but it doesn't work. >> >> Explain your needs in English,. >> >Ok, >I have created this website www.excel-exercice.com >For each item, I have 2 parameters, the language (0 or 1) and the >criteria for the item (1-1-1 ; 3-2-1 ; ......) >So, when you select one item, you have for instance the following URL >http://www.excel-exercice.com/index....g=0&var1=2-1-1 and I would >like to have something like http://www.excel-exercice.com/border-and-pattern.html > >I have 155 items for the French language and 46 in English but it >doesn't disturb me to write as many URL in my .htaccess as necessary. > >Does these explanations are enough or you need further info ? Though it might work with rewrites, I would handle it in PHP, with a database behind it for the mapping of logical names (border-and-pattern.html) which are in $_SERVER['PATH_INFO'] to IDs (lang=0&var1=2-1-1). These articles describe a suitable technique, although it is applied to different problems: http://richardlynch.blogspot.com/200...sposition.html http://www.sitearticles.com/index.ph...rintable&id=18 Of course there are many ways to Rome, I just wanted to show you this one. -- ( Kees ) c[_] Life is what happens while you are busy making other plans..... (John Lennon) (#452) |
|
![]() |
| Outils de la discussion | |
|
|