LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-08-2014, 04:25 AM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Apache: how to include last page served in a RewriteCond directive


Hi there,

here is the situation.

I run a the polyglot website http://slint.fr and my question is about "how to serve a page in the language preferred by the user, if available?"

At the moment I use Multiviews to add a language code to the requested URL according to the AcceptLanguage header (e.g. if "tr", serve index.html.tr instead of index.html), but this information doesn't always match user wish and I was told that serving different filenames for the same requested URI can prevent proper pages indexing by search engines.

So, I will now store web pages in each language in a specific directory, e.g. subdirectories en, it ru, tr, etc. For instance /tr/index.html will be in Turkish.

On every page, user can change language clicking on a link showing e.g. "tr" for Turkish. Now I want that once they do that all pages requested by the same client be served in the same language, unless/until user click on another language link.

I know that I could set a cookie or use HTTP-REFERER for that, but possibly the browser can be set to refuse cookies or not sent the Referer HTTP header.

So my question is : knowing that when a user click on a language link we serve a page in the corresponding directory, how could I reuse that information for next request of the same client (same IP address), including it in a RewriteCond directive so that I can serve requested page in the same language directory, if it exists.

I wish to avoid server side scripting (at present the website is 100% static).

Also, I would be grateful of any pointer to a more specialized place where to ask that question.

Last edited by Didier Spaier; 02-08-2014 at 04:37 AM.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning C programming- exceptions to whitespace irrelevant? include directive keithostertag Programming 3 02-01-2012 01:06 PM
Apache rule loop - make RewriteCond explicit timmywo Linux - Software 7 04-18-2010 08:50 AM
Correct Apache RewriteCond to stop proxying ... curtisa Linux - Security 1 07-21-2009 10:38 AM
echo text from an apache served web page to a fifo file? johnson_steve Linux - Server 2 07-25-2008 10:24 AM
%include directive in Kickstart configuration file deepika Linux - Newbie 0 07-24-2003 05:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration