I am running a CMS system similar to PHP-nuke called e-xoops and I am trying to switch it over to search engine friendly URL's using code similar to what is found here:
http://www.aquanuke.com/article358.html
E-xoops is a little different though. The first thing I am trying to figure out is how to get the URL's for the links module to look like:
http://www.mysite.com/modules/mylinks/viewcat8.html
instead of
http://www.mysite.com/modules/mylinks/viewcat.php?cid=8
This is what I tried - in the header section I put:
ob_start();
function replace_for_mod_rewrite(&$s){
$in = array("'(?<!/)modules/mylinks/viewcat.php?cid=([0-9]*)'"
);
$out = array("modules/mylinks/viewcat\\1.html"
);
$s = preg_replace($in, $out, $s);
return $s;
}
and in the footer I put:
$contents = ob_get_contents(); // store buffer in $contents
ob_end_clean(); // delete output buffer and stop buffering
echo replace_for_mod_rewrite($contents); //display modified buffer to screen
global $dbg_starttime;
Nothing changes though. I'm guessing I have the wrong syntax for the $in array, but I don't know PHP syntax as to how it should be formed. Any help is greatly appreciated.
For all I know, though, it could be something else I entirely am missing. Once I get the URL's looking search engine friendly, I'll then work on the mod-rewrite in my .htaccess file to direct it to the correct dynamic page.
Thanks.