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