Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8762167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:27:43+00:00 2026-06-13T15:27:43+00:00

I have a multi-language website and I want to display the current language in

  • 0

I have a multi-language website and I want to display the current language in the URI which is something like this:

URI:

www.domain.com/en/
www.domain.com/en/folder1/
www.domain.com/de/
www.domain.com/de/folder2/

DIRECTORY:

public_html/
public_html/folder1/
public_html/
public_html/folder2/

Then the en or de will be saved in a cookie to process the language code.
Is it possible to do these? Even without the actual folder of the en or de?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:27:44+00:00Added an answer on June 13, 2026 at 3:27 pm

    You can use mod_rewrite to internally rewrite the URI to remove the language and use the CO flag to set a cookie. So something like this (in the htaccess file in your document root):

    RewriteEngine On
    # first check the the folder/file actually exists:
    RewriteCond %{REQUEST_URI} ^/[a-z]{2}/(.*)$
    RewriteCond %{DOCUMENT_ROOT}/%1 -f [OR]
    RewriteCond %{DOCUMENT_ROOT}/%1 -d
    # rewrite and set cookie:
    RewriteRule ^/?([a-z]{2})/(.*)$ /$2 [L,CO=lang:$1:domain.com]
    

    This will set a cookie named lang with the value equal to the 2 letter prefix in the original URI and with the domain as domain.com.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-language website. I want a module to add multiple version of
I have a multi-language website and I'm puting the language in the URL like
I have a multi language website which requires both English language and Azeri characters
So I want to make my page to have multi language function, like German,
I have a multi-language .Net 4 webforms site (www.example.com/en/, www.example.com/fr/ etc.) and each language
I have a multi-language website that communicates with a database, which contains language-specific translations.
I have successfully implemented a multi-language website in which user can change language by
I have multi-language website in Drupal, but not all content is translated. I want
I want to make a multi-lingual website that defaults to English like example.com with
I'm working on a multi-language website. I have a problem with the color of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.