C'est ce que j'ai fait dcz ...
tu le peux constater de toi même... ou je me suis planter ?
bon alors la fin du fichier :
- Code: Tout sélectionner
/**
* Will return the remaining GET vars to take care of
* @access private
*/
function query_string() {
if(empty($this->get_vars)) {
return '';
}
$params = array();
foreach($this->get_vars as $key => $value) {
$params[] = $key . '=' . $value;
}
return '?' . implode('&', $params);
}
// --> Add on Functions <--
// --> Gen stats
/**
* Returns usable microtime
* Borrowed from php.net
* Required for the phpBB SEO Google sitemaps module
*/
function microtime_float() {
return array_sum(explode(' ',microtime()));
}
}
?>
le résultat donne ceci :
- Code: Tout sélectionner
/**
* Will return the remaining GET vars to take care of
* @access private
*/
function query_string() {
if(empty($this->get_vars)) {
return '';
}
$params = array();
foreach($this->get_vars as $key => $value) {
$params[] = $key . '=' . $value;
}
return '?' . implode('&', $params);
}
// --> Add on Functions <--
// --> Gen stats
/**
* Returns usable microtime
* Borrowed from php.net
* Required for the phpBB SEO Google sitemaps module
*/
function microtime_float() {
return array_sum(explode(' ',microtime()));
}
// --> Zero Duplicate
/**
* Custom HTTP 301 redirections.
* To kill duplicates
*/
function seo_redirect($url, $header = "301 Moved Permanently", $code = 301, $replace = TRUE) {
global $db;
if ( !empty($db) ) {
$db->sql_close();
}
if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") || strstr(urldecode($url), ';url')) {
message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
}
$http = (@function_exists("getallheaders")) ? "HTTP/1.1 " : "Status: ";
header($http . $header, $replace, $code);
header("Location:" . $url);
exit();
}
/**
* Helps out grabbing boolean vars
*/
function seo_cond($bool = FALSE, $or = FALSE) {
if ( $bool || ($this->do_redir && $or) ) {
$this->do_redir = TRUE;
}
return;
}
/**
* Returns the REQUEST_URI
*/
function seo_req_uri() {
// Apache mod_rewrite
if ( isset($_SERVER['REQUEST_URI']) ) {
return $_SERVER['REQUEST_URI'];
}
// IIS isapi_rewrite
if ( isset($_SERVER['HTTP_X_REWRITE_URL']) ) {
return $_SERVER['HTTP_X_REWRITE_URL'];
}
// no mod rewrite
return $_SERVER['SCRIPT_NAME'] . ( ( isset($_SERVER['QUERY_STRING']) ) ? '?'.$_SERVER['QUERY_STRING'] : "" );
}
/**
* check start var consistency
*/
function seo_start($start = 0, $limit = 0) {
if ($limit > 0) {
$start = ( is_int( $start/$limit ) ) ? $start : intval($start/$limit)*$limit;
$this->start = ( $start > 0 ) ? $this->seo_static['start'] . $start : '';
} else {
$this->start = ( $start > 0 ) ? $this->seo_static['start'] . $start : '';
}
}
}
?>
et ça marche lol.
par contre en tapant -http://mon_site.com/ => je n'obtiens plus la redirection sur -http://mon_site.com/index.html
ça ne fonctionne plus le rewriting ?