0

I encounter some issues about the url that won't rewrite in frontend (only) of Joomla but I can't find where is the exact issue.

This is the situation:

  • I installed a quickstart package in a folder named "en"
  • I use htaccess codes to rewrite the url from test123.com/en to test123.com

RewriteEngine On

RewriteCond %{HTTP_HOST} ^test123.com$ [NC,OR]

RewriteCond %{HTTP_HOST} ^www.test123.com$

RewriteCond %{REQUEST_URI} !en/

RewriteRule (.*) en/$1 [L]

  • Both Search Engine Friendly URLs & Use URL Rewriting are enabled in Joomla backend and I can see backend url has changed to test123.com (without en) - working for the backend.
  • However, the frontend will still show the folder name in URL test123.com/en

We tried:

  • Update Joomla to the latest version (won't fix)

  • RewriteBase /en/ (won't fix)

  • RewriteBase / (won't fix)

This issue is affecting many of our components won't work properly untill we turn both settings off as it will return "file not found" at times or 404 error or won't redirect properly.

Please advise what could be the issue and any solution to fix it?

May I know which files are related to generate the front page?

In this case, how do we create a fresh Joomla core with all the data, templates, components, plugins, modules and settings stay the same?

Thanks

| improve this question | | | | |
  • Can you change document root property in your web server configuration. Assuming Apache2.4, DocumentRoot. – David Hayes Dec 18 '19 at 6:37
0

If you edit the configuration.php file in your Joomla root and insert the full URL in the livesite= variable it should work as you expect it to.

eg.

livesite="http://www.test123.com'

You can't edit the value through the Configuration Settings in Joomla, you have to do it via your control panel editor or whatever you have available to you.

The .htaccess file, or the part that matters, that I use for my sites is;

# Internally Rewrite requests for Test123 to hide the subdirectory in the URL
    RewriteCond %{HTTP_HOST} ^www\.test123\.com\.au$
    RewriteCond $1 !^excluded_dir
    RewriteRule (.*) /en/$1 [L]
| improve this answer | | | | |
  • Thanks for the info. Yes, it is already set to $live_site = 'test123.com'; but still having the same issue. I'm curious why only the frontend won't work, but the backend is totally fine. – user2976317 Dec 18 '19 at 10:58
  • In your second last line of your .htaccess code you have 'RewriteCond %{REQUEST_URI} !en/' while the '!' is saying to exclude that directory from being rewritten. I will update my answer with the .htaccess that I use for my sites. – Irata Dec 18 '19 at 11:13
  • Got it, it is working now. Thank you! – user2976317 Dec 18 '19 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.