Home Forum
2024-12-22
Benvenuto, Ospite
Nome Utente Password: Ricordami

Meta Tags not working on Homepage
(1 Online) (1) Ospite
  • Pagina:
  • 1

ARGOMENTO: Meta Tags not working on Homepage

Meta Tags not working on Homepage 14 Anni fa #1669

Hi there,

I'm a complete newbie to Joomla so please bear with me. I've installed Tag Meta and configured it to add meta tags to the homepage of the site I'm working on: www.firecreative-uk.com

I've used an item matching on ^/$ to match the homepage of the site as suggested in the user guide. However when I view the homepage no title tag, keyword or description tags are added. I have set the Tag Meta plugin as the last one in the list. Whatever I do I can't get any Meta tags to appear on my home page. It may be a problem within the Joomla template itself I don't know as I don't have any experience with Joomla.

Any help appreciated.

Thanks
Simon
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 14 Anni fa #1671

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Simon,
try to switch to REDIRECT mode (plugin advanced options).

If still not work, I can check settings for you. If you trust, create a temporary account to backend and send me an email at info(at)sistemistica.it.

Regards,
Luigi
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 11 Mesi fa #1754

  • Tom
  • Offline
  • Fresh Boarder
  • Messaggi: 1
Hi Luigi,

I like the idea of your plugin. Obviously I have the same problem as described by Simon before. I already tried several variations of the URI and activated the REDIRECT. Meta-tags remain always the global ones. I suppose a problem with the template as well.

URL: www.english-for-children.com

Many thanks in advance

Tom
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 11 Mesi fa #1755

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi Tom,
could you please, provide me a temnporary account for backend? If you trust, send me a PM at info(at)sistemistica.it.

If not, please, send me a dump of Tag Meta table, and a screenshot of plugin settings.

Best regards,
Luigi
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 9 Mesi fa #2009

  • sbrandon
  • Offline
  • Fresh Boarder
  • Messaggi: 3
Hi,

It doesn't work on my homepage either, and I've tried the REDIRECT switch in the plugin too, though it makes no difference. [update: found the reason why; see below]

There's something screwy going on in the Apache headers and the way you're detecting them, which only happens for the front page.

My installation is on localhost, in a subdirectory: localhost/j157/

I have joomla standard SEF URLs turned on.

URLs like localhost/j157/news work fine. $currenturi in the plugin is calculated correctly (/j157/news)

However, the front page of my site is localhost/j157/
but $currenturl is calculated as:

/j157/index.php?

(including the trailing "?")

I know that I can check for that and it works to identify the front page... but this is a bit horrible and I'd prefer to be checking for ^/j157/$ or ^/$.

Here's my $_SERVER array as seen in the plugin:

Array
(
[UNIQUE_ID] => XXXXXXXXXXXXXXXXXX
[HTTP_AUTHORIZATION] =>
[HTTP_HOST] => localhost
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_ACCEPT_LANGUAGE] => en-us
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
[HTTP_ACCEPT] => application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
[HTTP_CACHE_CONTROL] => max-age=0
[HTTP_COOKIE] => XXXXXXXXXXX
[HTTP_CONNECTION] => keep-alive
[PATH] => /usr/bin:/bin:/usr/sbin:/sbin
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => /Applications/XAMPP/xamppfiles/htdocs
[SERVER_ADMIN] => Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
[SCRIPT_FILENAME] => /Applications/XAMPP/xamppfiles/htdocs/j157/index.php
[REMOTE_PORT] => 63992
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /j157/index.php?
[SCRIPT_NAME] => /j157/index.php
[PHP_SELF] => /j157/index.php
[REQUEST_TIME] => 1301370468
[argv] => Array
(
)

[argc] => 0
[HTTP_REQUEST_URI] => /j157/index.php?
)


When I request a subpage on the site:

Array
(
[REDIRECT_UNIQUE_ID] => TZFW-ArTNwIAABVDOiQAAAAJ
[REDIRECT_HTTP_AUTHORIZATION] =>
[REDIRECT_STATUS] => 200
[UNIQUE_ID] => XXXXXXXXXXXXXXXXXXXXXX
[HTTP_AUTHORIZATION] =>
[HTTP_HOST] => localhost
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
[HTTP_ACCEPT] => application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
[HTTP_REFERER] => localhost/j157/
[HTTP_ACCEPT_LANGUAGE] => en-us
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_COOKIE] => XXXXXXXX
[HTTP_CONNECTION] => keep-alive
[PATH] => /usr/bin:/bin:/usr/sbin:/sbin
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8l PHP/5.2.9 mod_perl/2.0.4 Perl/v5.10.0
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => /Applications/XAMPP/xamppfiles/htdocs
[SERVER_ADMIN] => Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
[SCRIPT_FILENAME] => /Applications/XAMPP/xamppfiles/htdocs/j157/index.php
[REMOTE_PORT] => 64005
[REDIRECT_URL] => /j157/articles
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /j157/articles
[SCRIPT_NAME] => /j157/index.php
[PHP_SELF] => /j157/index.php
[REQUEST_TIME] => 1301370620
[argv] => Array
(
)

[argc] => 0
)


Using this information I tracked down in my installation, places where REQUEST_URI gets set.

I found it inside the "S2 framework" used in JReviews. There's a check in there that is supposed to detect IIS servers, and "fix" the REQUEST_URI:

/*
* REQUEST_URI for IIS Servers
* Version: 1.1
* Guaranteed to provide Apache-compliant $_SERVER['REQUEST_URI'] variables
* Please see full documentation at

* Copyright NeoSmart Technologies 2006-2008
* Code is released under the LGPL and may be used for all private and public code

* Instructions: neosmart.net/blog/2006/100-apache-compliant-request_uri-for-iis-and-windows/
* Support: neosmart.net/forums/forumdisplay.php?f=17
* Product URI: neosmart.net/dl.php?id=7
*/

Unfortunately it's getting it wrong, and messing up REQUEST_URI. I commented out the 2 lines that set REQUEST_URI and then Tag Meta started working properly.

In fact it's as easy as commenting out this line in /components/com_s2framework/s2framework/dispatcher.php:

// Fixed REQUEST_URI for IIS
// $this->getUri();

(as long as you are not using IIS, of course).


I hope that helps some others.
Cheers,
Stephen
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 9 Mesi fa #2010

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
I have nothing to add to this, your analysis is PERFECT.

Only one suggestion you could try to avoid to modify the wrong code (this is something I hate). You could just try to "prevent" the problem. How?

I found it inside the "S2 framework" used in JReviews.


I don't know if this is a system plugin, but if so, just try to put this as last plugin after Tag Meta (normally Tag Meta should be the last one). Maybe Tag Meta start to work...

Anyway, your trace is perfect, and I hope this could be useful to someone else.

Best regards,
Luigi
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 9 Mesi fa #2011

  • sbrandon
  • Offline
  • Fresh Boarder
  • Messaggi: 3
Sadly it's not a system plugin. It's part of a content plugin (Jreviews content plugin) so the system ordering isn't going to help.

I also want to experiment a little with the way Tag Meta gets the URL. Instead of getting it direct from the headers, how about getting it from JURI?

$uri = clone(JURI::getInstance());
$currenturi = $uri->_uri;

That's what lots of other things in Joomla use to get it, and I think it will help in this case. This also appears to be unaffected by the JReviews mess.

I'll leave that with you...

By the way I always highly recommend the use of TagMeta on every website I build. I'm going to be giving training to a bunch of webmasters in Belgium next week and this will form part of the SEO presentation, which was why I was testing out the new version today. Thank you so much for making this freely available. It's great to be able to manage all the titles and metadescriptions in one place - and I'm looking forward to experimenting with the Canonical support as well.

Cheers,
Stephen
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 9 Mesi fa #2012

  • sbrandon
  • Offline
  • Fresh Boarder
  • Messaggi: 3
With regard to my last post: $uri->_uri gives a full URL eg. localhost/j157/ whereas you just want the file path part of it, e.g. /j157/

So you could still use it by stripping the scheme and host from the URL obtained.

There are other methods on the JURI object that should be able to recreate the URL, but I'm always a bit hesitant that I'm going to get back the exact URL if it has been deconstructed and reconstructed...

Cheers,
Stephen
L'Argomento è stato bloccato.

Re: Meta Tags not working on Homepage 13 Anni, 9 Mesi fa #2013

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
since the first version of Tag Meta I used this piece of code to get the current URL:

    if ( ($params->get('redirect', 0) == 1) && ( (isset($_SERVER['REDIRECT_URL'])) || (isset($_SERVER['HTTP_X_REWRITE_URL'])) ) ) {
$currenturi = (isset($_SERVER['HTTP_X_REWRITE_URL'])) ? $_SERVER['HTTP_X_REWRITE_URL'] : $_SERVER['REDIRECT_URL'];
} else {
$currenturi = $_SERVER['REQUEST_URI'];
}


In this way I can support both IIS and Apache even for rewritten URL, and the code is minimal, I get just what I need. If you take a look at getinstance code, there are a lot more instructions that provide informations I really don't need. So, my choice is just for performance reasons...

This piece of code is executed for each Joomla call, so it should be as fast as possible.

Thanks for your suggestion,
Luigi
L'Argomento è stato bloccato.
  • Pagina:
  • 1
Moderatori: admin
Tempo generazione pagina: 0.55 secondi
Cerca con Google
News
Chi è online
 261 visitatori online
Sponsor

slotmachineaamsonline.com è una guida alle migliori slot machine online legali in Italia. Sul sito trovi un elenco sempre aggiornato dei casino online con Slot machine e bonus slot, le ultime novità dal mondo delle slot online e le migliori strategie per vincere. Inoltre, è disponibile una sezione dedicata alle slot machine da BAR che finalmente sono disponibili nella versione online.