Language Redirect

This is a discussion on Language Redirect within the Apache Web Server forums, part of the Web Server and Related Forums category; Hiyas, I guess you all know the Apache2 Documentation: http://httpd.apache.org/docs-2.0/ They handle their displayed ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-03-2005
Alexander Scheurer
 
Posts: n/a
Default Language Redirect

Hiyas,

I guess you all know the Apache2 Documentation:
http://httpd.apache.org/docs-2.0/

They handle their displayed language with type-maps as you can also
choose another language via a link. I tried it on my homeserver and its
working fine, but I also want to have it on a website that I'm having at
hosteurope.de. So as I don't have access to the httpd.conf I'm trying to
get it work with .htaccess and its an Apache 1.3 so this is what I got now:

*code*
AddHandler type-map var
AddLanguage en .en
AddLanguage de .de
LanguagePriority en de
<Files *.var>
SetHandler type-map
</Files>
SetEnvIf Request_URI ^/manual/(de|en)/ prefer-language=$1
Redirect 301 /manual/de http://www.bsc-truchtelfingen.de/manual
Redirect 301 /manual/en http://www.bsc-truchtelfingen.de/manual
*code*

So this is working as far as the type-maps go, but clicking a link
doesn't change anything (language). It must be something with the
SetEnvIf but I can't get it working.

Here the orginal code apache.org is using:

*code*
AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$
"C:/Programme/Apache Group/Apache2/manual$1"

<Directory "C:/Programme/Apache Group/Apache2/manual">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all

<Files *.html>
SetHandler type-map
</Files>

SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/
prefer-language=$1
RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$
/manual/$1$2
</Directory>
*code*

Thx
Alex
  #2 (permalink)  
Old 03-03-2005
Joshua Slive
 
Posts: n/a
Default Re: Language Redirect


Alexander Scheurer wrote:
>
> SetEnvIf Request_URI ^/manual/(de|en)/ prefer-language=$1
> Redirect 301 /manual/de http://www.bsc-truchtelfingen.de/manual
> Redirect 301 /manual/en http://www.bsc-truchtelfingen.de/manual


That won't work because the environment variable set by SetEnvIf is
lost when doing a Redirect. That is why the original version uses
Alias, where the translation is internal and the environment variable
is retained.

If you have access to mod_rewrite, you can try RewriteRule. Otherwise,
I think you are out of luck.

Joshua.

  #3 (permalink)  
Old 03-03-2005
Terry
 
Posts: n/a
Default Re: Language Redirect

Alexander Scheurer wrote:
[snip]
> SetEnvIf Request_URI ^/manual/(de|en)/ prefer-language=$1
> Redirect 301 /manual/de http://www.bsc-truchtelfingen.de/manual
> Redirect 301 /manual/en http://www.bsc-truchtelfingen.de/manual
> *code*
>
> So this is working as far as the type-maps go, but clicking a link
> doesn't change anything (language). It must be something with the

This is probably stupid, but should not the second 301 be
truchtelfingen.EN ?

I am a beginner but if you are as lazy a typist as I am you copied and
pasted the actual code. (it sure looks wrong to me)

HTH
TK
who often can not see the forest for the trees.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0