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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:48:04+00:00 2026-06-10T03:48:04+00:00

I have got a multilingual joomla 2.5 website with sef urls enabled. The page

  • 0

I have got a multilingual joomla 2.5 website with sef urls enabled. The page relies heavily on ajax, so every kind of content is pulled from the server after the good old

window.onload

event. To make everything work proper and urls look nice, I want to force Joomla to always respond in the sites default language if the page loaded and the index.php of the template in invoked.

Or to describe the problem diffrent:

If an ajax-call pulls an item which is different from the default language and a page-refresh follows, joomla redirects to the homepage in the language of the last ajax-call, that is what I want to prevent.

Greetings

  • 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-10T03:48:05+00:00Added an answer on June 10, 2026 at 3:48 am

    Got it working! The question itself was wrong! I should have been asking: “How to redirect to frontpage in default language?”

    Answer:

    $app = JFactory::getApplication();
    $doc = JFactory::getDocument();
    $languages = JLanguageHelper::getLanguages('lang_code');
    $lang = JFactory::getLanguage();
    $defaultLang = ( $lang->getTag() == $lang->getDefault() ) ? $lang : JLanguage::getInstance( $lang->getDefault() );
    
    
    if( ! ( $lang->getTag() == $defaultLang->getTag() ) ){
        $app->redirect( JRoute::_( 'index.php?lang='.$languages[ $defaultLang->getTag() ]->sef ), 'hallo', true );
    }
    

    Done!

    Greetings….

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

Sidebar

Related Questions

I have got idea of how to build a website in 2 languages, i
I want to have a feature for my website which can print the page
have got a problem with do this kind of code , can't figure how
I have got a little problem. I got a bxslider running on a website
I have got site with dynamic refreshing divs. Source: <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js></script> <script> var auto_refresh
I have got a page which lets me control some devices in a local
Have got an NSString *str = @12345.6789 and want to find out if there
I have got the requirement to find the core file in multiple box/machine and
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I have got a form into which information is entered, and a drop down

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.