

The problem is that both rewrite rules in the .htaccess-file are going to modify our URL regardless if it's of the type 0.0.0.0.0.html or mypage.html.
The base idea is to change the URL to make it different for the rewrite rules !!! You don't understand ?? You will in 1 minute
We change the url_search function to generate a URL with an .htm ending for the 0.0.0.0-type and an .html ending for the mypage-type, so the rules will only match once. It's really simple

Change the function url_search in front.func.inc.php
Code: Select all
Line: 1185
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).".htm"; //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);
}
Code: Select all
DirectoryIndex index.php
RewriteEngine on
# if your in an subdirectory called "phpwcms" define the rewrite-base
# RewriteBase /phpwcms
# This will rewrite 0.0.0.0.0.html => index.php?id=0.0.0.0.0
RewriteRule ^(.*)\.htm$ /index.php?id=$1
# This will rewrite mypage.html => index.php?mypage
RewriteRule ^(.*)\.html$ /index.php?$1
I've tested only with normal URLs, maybe we need to rework the PopUp and JavaScript-Functions too.
What do you think ??
Is it working for you ??
Please let me know !!!
[ p i x e l p e t e r ]