|
Thursday, 24 April 2008 |
Ok, let me explain what do I mean with this title. I'm using Artio JoomSef component for SEO urls on Joomla 1.0.x. Link to root of my sections and categories end with /index.html for an example:
http://www.vitez-studios.com/section/category/index.html However, I have found out that Google bot is trying to open
http://www.vitez-studios.com/section/category/ without index file, assuming that it will retrieve different content. Of course, Google has received a lot of 404 errors which might compromise my web site indexing. I decided to do some changes in JoomSef code. The plan was to automatically redirect all request urls which may be directories without ending slashes, to same urls with glued index.html
If you would like to add such compatibility to your JoomSef component read the following. Please note that my changes wont add new records to JoomSef mysql tables. If no url is found in database, JoomSef will check for additional url with index.html at the end of string. If match is found, Joomla will redirect user with http error code 302, instead of responding with error code 404.open your Joomla root directory and open this file components/com_sef/sef_ext.php Find function revert() in class sef_joomsef. Look for this code
if ($row) { // Use the already created URL $string = $row->newurl;
Add this code right before!
/*--------------------------- # see if url is actually a dir root # # By Vitez ----------------------------*/
if (! $row) { global $mosConfig_live_site; $isSlash = substr($req, -1) == '/'; $req .= $isSlash ? '' : '/'; $req .= $sefConfig->addFile; // try to load again with trailing slash $sql = "SELECT * FROM #__redirection WHERE `oldurl` = '".$req."' AND `newurl` != '' LIMIT 1"; $database->setQuery($sql);
// Try to use cache if ($sefConfig->useCache) { $row = $jsCache->getNonSefUrl($req); } else { $row = null; } if ($row) { // Cache worked $fromCache = true; } else { // URL isn't in cache or cache disabled $fromCache = false; $row = null; $database->loadObject($row); } // provjeri da li je zatrazen dir bez trailing slasha // u tom slucaju redirectaj sa trailing slashom if ($row && ! $isSlash) { $f = $d = ""; if (!headers_sent($f,$d)) { header("Location: {$mosConfig_live_site}/".$req); exit(); } else { die("SEO error -> cannot redirect. Headers already sent at line {$d} in file {$f}"); } } // fake it $fromCache = true; } // END.Vitez
Thats it, try it. If you experience problems feel free to contact me ;)
|
|
Wednesday, 23 January 2008 |
Unfortunately NoFollow mambot will not work on menu items in your
Joomla because there is no Mambot event I could attach parsing
functions to.
There fore I came up with an idea to solve the issue. You'll have to
edit your Joomla source files. Please note that this procedure requires
some skills. You do that on your own risk.
Basically you need to change few lines of code. This tutorial is tested on joomla version 1.0.13 |
|
Read more...
|
|
|
Wednesday, 12 December 2007 |
|
|
Read more...
|
|
|
Sunday, 09 December 2007 |
|
|
Read more...
|
|
|
Wednesday, 03 October 2007 |
We've put together some of the more frequently used SSH commands or
linux shell commands, and organized them by name so you can easily find
a command, their description and how to use it. This guide will
continue to be updated and should not be considered a complete list of
SSH commands or linux shell commands, but commands, we found, often
used. If you would like to add to this guide, please email us and let
us know.
|
|
Read more...
|
|
|
Thursday, 13 September 2007 |
|
The most common setting that clients will want to change are the
“register_globals” settings. If you want to enable register_globals,
you will need to create a .htaccess file in your site’s main directory
(or the main directory of your site that contains PHP hosting scripts). Your .htaccess file should contain the following line:
php_flag register_globals on
If you want to disable register_globals then your .htaccess file should contain the following line:
php_flag register_globals off
Here is how to enable register_globals via .htaccess:
1. Create an .htaccess in your virtual host's root directory
2. put the following code in it:
# Override PHP settings. The first IfModule is # for Apache 1.3, the second for Apache 2.
<IfModule mod_php4.c> php_value register_globals 1 </IfModule>
<IfModule sapi_apache2.c> php_value register_globals 1 </IfModule>
php_flag register_globals 1
3. Save the settings |
|
|
|