I need to honor the web browser's list of language preferences. Supported languages are English and French. For example: http_accept_language="jp-JP;fr;en-US;en" redirects to a directory called /French/. How can I do this with rewrite rules in my .htaccess file?
相关问题
- Backbone.js PushState routes .htaccess only workin
- Stop .htaccess redirect with query string
- .htaccess rule, redirecting old unexistent address
- How to deploy a web application Aurelia in an Apac
- Apache Directory Studio not opening
相关文章
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- How reliable is HTTP_HOST?
- Making a two way SSL authentication between apache
- UnicodeEncodeError when saving ImageField containi
- mod_rewrite only on GET
- jquery how to get the status message returned by a
- How do I debug errors that have no error message?
- Multiple htaccess rewrite rule
I wouldn’t use mod_rewrite for this but a more powerful language. Because Accept-Language is a list of weighted values (see quality value) and the occurrence of one of the identifiers does not mean that it’s preferred over another value (especially
q=0
means not acceptable at all).As already said, use a more powerful language than mod_rewrite, parse the list of value and find the best match of preferred options and available options.