Hi,

to provide virtual URLs which are redirected by content negotiation based on 
the Browsers accept-language header, I use PHP files as follows for example for 
http://hostname.domain/shorturl which is redirected to 
http://hostname.domain/de/path/to/file.html for German readers, 
http://hostname.domain/en/path/to/file.html for English and likewise for 2 
other languages.

As I don't like to use PHP on that server at all, other solutions are 
preferred. Using RewriteMap failed as RewriteMap seems to combine with 
mod_negotiation or MultiViews only on the destination path 
(de/path/to/file.html) of the rewrite map not the key (/shorturl).

And to rebuild the internal functions of MultiViews by a list of RewriteCond 
isn't possible if you want evalution of more elaborated Accept-Language headers 
like "de-de, de;q=0.75, en-us;q=0.50, en;q=0.25" which MultiViews and 
mod_negotation eat easily.


file shorturl.php.en:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Status: 301 Moved Permanently");
header("Location:http://"; . $_SERVER["HTTP_HOST"] . "/en/path/to/file.html");
header("Connection:close");
exit;
?>


file product.php.de:

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Status: 301 Moved Permanently");
header("Location:http://"; . $_SERVER["HTTP_HOST"] . "/de/path/to/file.html");
header("Connection:close");
exit;
?>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to