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 7757335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:04:03+00:00 2026-06-01T13:04:03+00:00

I have this application that I want to support multi languages. I thought the

  • 0

I have this application that I want to support multi languages.
I thought the easiest way would be to use sub domains aka

http://fr.domain.com/content

Now I created the sub domain on my server, pointing to the main root and indeed, the above URL is accessible.
The problem now are all my links, which are absolute.
Is there a way with mod_rewrite to catch the language from the URL and than rewrite the links to the same sub domain URL?

So if we are on http://fr.domain.com/content and click the link http://domain.com/link I want the page to load as http://fr.domain.com/link

Is that possible?
Cheers!

  • 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-01T13:04:04+00:00Added an answer on June 1, 2026 at 1:04 pm

    You would probably have to check HTTP_REFERER if you want to do this through apache. It might be good to start updating the site so that the links are dynamic in the future…

    Something like (I can’t really test this currently):

    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_HOST} !^[a-z]{2}\.host\.com$ [NC]
    RewriteCond %{HTTP_REFERER} ^http://([a-z]{2})\.host.com/.*$ [NC]
    RewriteRule (.*) http://%1.host.com/$1 [R,L,QSA]
    

    EDIT: removed a NOT in the 3rd condition

    You might have to check some other conditions, but test things out to figure out what works. Plus, if you do other redirects you need a way to maintain the original referrer. In some ways even with the links the way they are, it may be easier to do this through a more dynamic means with php (through session) or something.

    I was using these:

    http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_REFERER

    http://www.askapache.com/htaccess/modrewrite-tips-tricks.html

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

Sidebar

Related Questions

I have this web application that has grown to an unmanageable mess. I want
I have an application that passes in java.util.Date. I want to check whether this
I have an C# form application that use an access database. This application works
I have a closed-source Linux application that I want to distribute. This application is
I have this application that need to do some things in protected paths (like
I have this application that will recurse all folders in a given directory and
So I have this c# application that needs to ping my web server thats
I have an existing application that is written in C++ for Windows. This application
I have a VB6's Application that is in production environment right now, this application
I have this senario. We have an application server that contains a few web

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.