1
Hi Xoopser,
SEO is in action at my site
http://thej2ee.com It is a great to have feature for XOOPS community and I'm sure that everyone will like to see its support in the CORE.
I found one hack, which was doing ob_start and huge regex replacement to generate URL like
http://thej2ee.com/software/cat/130/ . This approach lack in putting related words in URL itself.
So I worked on cloned module to get more SE attention. And now it is generating URLs like
http://thej2ee.com/software.cat.130/web-frameworks.htmlhttp://thej2ee.com/software.link.1488/struts.htmlThe base software module was a perfect clone of mylinks as mentioned here
http://xoops.biz/x7/modules/myhacks/index.php?id=3 .
For "code junkies", I am listing the highlights.
function software_sefriedly_url($id, $type, $title="") {
$words = preg_split('/[^0-9a-z]+/', strtolower($title));
return XOOPS_URL."/software.$type.$id/".implode($words, '-').'.html';
}
and
/.htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^software.link.([0-9]+)/ software.php?lid=$1
RewriteRule ^software.cat.([0-9]+)/ software.php?cid=$1
and
/software.php
$newUrl = 'modules/software/index.php';
if (is_numeric($_GET['lid'])) {
$newUrl = 'modules/software/singlelink.php';
} else
if (is_numeric($_GET['cid'])) {
$newUrl = 'modules/software/viewcat.php';
}
$PHP_SELF = '/'.$newUrl;
$_ENV['PHP_SELF'] = $PHP_SELF;
$_SERVER['SCRIPT_NAME'] = $PHP_SELF;
$_SERVER['PHP_SELF'] = $PHP_SELF;
$_SERVER['REQUEST_URI'] = $PHP_SELF . '?' . $_SERVER['QUERY_STRING'];
chdir(dirname($newUrl));
include($newUrl);
exit;
?>
Sudhaker Raj
............