Mod Rewrite does not work with Version 4/4-04?
Posted: Tue 6. Apr 2004, 01:25
Live site: http://realestatebuyingselling.com/home
Detail error: 404 URL not found
Then I Tried:
1/Enable .htacess with code:
===> Result: Click on all links on the left menu they would change the name.html correctly, BUT the page content would not change. All remain the same index page
2/Still keep that .htacess above,
Now I went to front.func.inc and change the code from:
to the code based on Pixelpeter method:
===>Result: Error call to un-define function
Any idea, please?
(I wish Oliver enhanced this function in the core version
)
Thanks
Detail error: 404 URL not found
Then I Tried:
1/Enable .htacess with code:
Code: Select all
RewriteEngine on
RewriteBase /home
# This will rewrite 0.0.0.0.0.html => index.php?id=0.0.0.0.0
RewriteRule ^([0-9]*).([0-9]*).([0-9]*).([0-9]*).([0-9]*).([0-9]*).html$ /home/index.php?#id=$1.$2.$3.$4.$5.$6
# This will rewrite mypage.html => index.php?mypage
RewriteRule ^(.*).html$ /home/index.php?$1
2/Still keep that .htacess above,
Now I went to front.func.inc and change the code from:
Code: Select all
//Rewrite functions
function url_search($query)
{
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html"; //further use
//$file = $noid.".html";
$link = "<a href=\"".$file."\"";
return($link);
//unset($link);
}
function js_url_search($query)
{
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html"; //further use
//$file = $noid.".html";
$link = "onClick=\"location.href='".$file."'";
return($link);
//unset($link);
} to the code based on Pixelpeter method:
Code: Select all
function url_search($query)
{
if ( subStr($query,0,4) == "?id=")
{
// this is for id=0,0,0,0,0
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html"; //further use
}
else
{
// this is for mypage.html
$noid = substr($query,1);
$file = str_replace(",", ".", $noid).".html"; //further use
}
$link = "<a href="".$file.""";
return($link);
} ===>Result: Error call to un-define function
Any idea, please?
(I wish Oliver enhanced this function in the core version
Thanks