0

SO i'm no Joomla expert by any means of the imagination.

My uncle has a website, that runs off Joomla and has this awkward issue.

When accessing the website without a www like so: http://website.com his title reads

<title>Title without www in url</title>

when accessing the website with www like so: http://www.website.com his title reads

<title>Title is different when www is inside the url</title>

Any ideas what's causing this?

1

In the Joomla backend, go to:

Menus >> Main Menu >> Home (or whatever your homepage menu item is)

Then go to the Page Display tab and you will see a field called Browser Page Title.

Fill this field in with the wording of your choice which should work for domains with and without www

Hope this helps

  • No luck... that's how we've been trying to fix it. – ipixel Feb 20 '15 at 14:21
  • Have any changes been made to the htaccess file? Or do you have any 3rd party extensions being used for your URL management or SEO? – Lodder Feb 20 '15 at 14:29
  • htaccess no, however they might be some SEO done. I can find out in a bit. – ipixel Feb 20 '15 at 14:58
  • So it turned out, there was an SEO extension installed that was overwriting the default <title> settings. THANKS! – ipixel Feb 23 '15 at 17:04
0

Sounds to me like this title could be generated from your template's index.php file (located in JOOMLAROOT/templates/YOURTEMPLATE/index.php).

To check this, log in to your Joomla admin area, and go to Extensions -> Template Manager.

Locate your default front-end template (#1, marked with a yellow star), and click the template name (#2).

enter image description here

You should now see a list of all your template files. Locate index.php in the list and click to edit the file.

enter image description here

Now look for <title> tags, <title>Title without www in url</title> or similar. There might be a PHP if-else statement to determine if the URL uses www or not. Here's an example on how this might look, but it could be different:

if(preg_match('/www/', $_SERVER['HTTP_HOST']))
{
  echo '<title>Title is different when www is inside the url</title>';
}
else
{
  echo '<title>Title without www in url</title>';
}
  • preg_match() is overkill for this answer. strpos($_SERVER['HTTP_HOST'], 'www') !== false) will be best practice. – mickmackusa Nov 30 '18 at 1:00

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.