5
Ok I tried the hack, it's ok for me to change
http://www.mysite.com/modules/articles/ in
http://www.mysite.com/onlinemagazine/and I don't need to have /pages/ directory in my URLs, but the hack simply don't work.
Don't know why.
I change the .htaccess this way
RewriteEngine on
RewriteRule ^linksutili/(.*)$ /modules/weblinks/$1 [L]
RewriteRule ^terapia/(.*)$ /modules/content/$1 [L]
RewriteRule ^main.css$ /xoops.css [L]
RewriteRule ^include/main.js$ /include/xoops.js [L]I change mainfile.php this way
$GLOBALS['_rewriteRulesFrom'] = array(
'/linksutili/',
'/terapia/',
'/main.css',
'/include/main.js',
);
$GLOBALS['_rewriteRulesTo'] = array(
'/modules/weblinks/',
'/modules/content/',
'/xoops.css',
'/include/xoops.js',
);
$GLOBALS['_abs_offset'] = preg_replace('/https?:\/\/'.$_SERVER["HTTP_HOST"].'/','',XOOPS_URL);
$GLOBALS['_rewriteRulesTo1'] = preg_replace('/^(.*)$/e','"!('.XOOPS_URL.'|\"".$GLOBALS["_abs_offset"]."|\'".$GLOBALS["_abs_offset"].")".preg_quote("\1","!")."!"', $GLOBALS['_rewriteRulesTo']);
$GLOBALS['_rewriteRulesFrom1'] = preg_replace('/^(.*)$/','\\\1\1',$GLOBALS['_rewriteRulesFrom']);
function modules_changer( $s ) {
$s = preg_replace($GLOBALS['_rewriteRulesTo1'],$GLOBALS['_rewriteRulesFrom1'], $s);
for($i=0; $i $s = preg_replace( '/('.preg_quote(XOOPS_URL,'/').'|"|\')'.preg_quote($GLOBALS['_rewriteRulesTo'][$i],'/').'/' , "\\1".$GLOBALS['_rewriteRulesFrom'][$i] , $s ) ;
}
return $s;
}
if (empty($_SERVER['REDIRECT_URL']) || ($_SERVER['REDIRECT_URL'] == $_SERVER['REQUEST_URI'])) {
if (empty($_SERVER['REDIRECT_REDIRECT_STATUS'])) {
if (($_changer_url=modules_changer('"'.$_SERVER['REQUEST_URI'].'"')) != '"'.$_SERVER['REQUEST_URI'].'"') {
header('Location: ' . str_replace('"','',$_changer_url));
}
}
}
$_SERVER['REQUEST_URI'] = str_replace( $GLOBALS['_rewriteRulesFrom'],$GLOBALS['_rewriteRulesTo'], @$_SERVER['REQUEST_URI'] ) ;
$_SERVER['HTTP_REFERER'] = str_replace($GLOBALS['_rewriteRulesFrom'], $GLOBALS['_rewriteRulesTo'], @$_SERVER['HTTP_REFERER'] ) ;
etc. etc. etc. Could be a problem with the modules I'm using?
Although I made this change, nothing happens.
Any idea?