//
// OPEN INCLUDE/INC_CONF/CONF.INC
// LINE: 62
//
///////////////////////////////////////////////////////////////////////////
// SEARCH FOR ///////////////////////////////////////
Code: Select all
$phpwcms["rewrite_url"] = 0; //whether URL should be rewritable
// REPLACE WITH ///////////////////////////////////////
Code: Select all
$phpwcms["rewrite_url"] = 1; //whether URL should be rewritable
// CLOSE
///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//
// OPEN INCLUDE/INC_FRONT/FRONT.FUNC.INC
// LINE: 1185
//
///////////////////////////////////////////////////////////////////////////
// SEARCH FOR ///////////////////////////////////////
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).".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);
}
// REPLACE WITH ///////////////////////////////////////
Code: Select all
//REWRITE - PATCHED FOR 04/04 // jan212
function url_search($query) {
if ( subStr($query,0,4) == "?id=") {
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html";
}
else {
$noid = substr($query,1);
$file = str_replace(",", ".", $noid).".html";
}
$link = "<a href=\"".$file."\"";
return($link);
}
function js_url_search($query) {
if ( subStr($query,0,4) == "?id=") {
$noid = substr($query, 4);
$file = str_replace(",", ".", $noid).".html";
} else {
$noid = substr($query,1);
$file = str_replace(",", ".", $noid).".html";
}
$link = "onClick=\"location.href='".$file."'";
return($link);
}
// -------------------------------------------------------------
// CLOSE
///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//
// SAVE THIS AS .HTACCESS IN THE PHPWCMS ROOT FOLDER
//
///////////////////////////////////////////////////////////////////////////
Code: Select all
php_flag magic_quotes_gpc Off
php_flag register_globals Off
DirectoryIndex index.php
RewriteEngine on
# if your in an subdirectory called "phpwcms" define the rewrite-base
# RewriteBase /phpwcms
# Otherwise remove the /phpwcms/ from the rewrite rules (should be
# index.php?id=$1.$2.$3.$4.$5.$6, index.php?$1 then)
# 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$
/phpwcms/index.php?id=$1.$2.$3.$4.$5.$6
# This will rewrite mypage.html => index.php?mypage
RewriteRule (.+)[.]html /phpwcms/index.php?$1
#THIS FOR LOGGING
#RewriteLog "/absolute/path/to/the/rewrite.log"
# 0 = Logging disabled, 9 = highest level of logging, only for debugging
#RewriteLogLevel 3
////////////////////////////////////////////////////////////////////////////
// IMPORTANTLY
// # if your in an subdirectory called "phpwcms" define the rewrite-base
// # RewriteBase /phpwcms
// # Otherwise remove the /phpwcms/ from the rewrite rules (should be
// # index.php?id=$1.$2.$3.$4.$5.$6, index.php?$1 then)
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// THAT'S IT
/////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// DEBUGGING
/////////////////////////////////////////////////////////////////////////
Error 404 - check your .htaccess again, the subdir, slashes and so on, normally the bug should be there if this type of error is displayed
Error 403, 500 - Apache misconfiguration - set up AllowOverride All and Options +FollowSymLinks in httpd.conf