Hello,
Voilà, j'ai un soucis d'URL rewriting pour mon annuaire Netref version 4.2d
J'ai posté un message dans le forum netref, mais y'a pas grand monde alors...
Je suis hébergé chez Nuxit (compatible URL rewriting. J'ai fait un essai pour confirmer avec la démarche expliquée dans GG trucs de pro et ca marche, pas de problèmes de ce coté là.)
Si il suffisait d'un fichier .htaccess, ce serait plus simple, mais y'a aussi du code pour l'URL rewriting dans une page.
Mon htaccess :
Ma page option.php (en partie)
Ce qui me donne une 404...
Quelqu'un à un indice à me donner...?
Voilà, j'ai un soucis d'URL rewriting pour mon annuaire Netref version 4.2d
J'ai posté un message dans le forum netref, mais y'a pas grand monde alors...
Je suis hébergé chez Nuxit (compatible URL rewriting. J'ai fait un essai pour confirmer avec la démarche expliquée dans GG trucs de pro et ca marche, pas de problèmes de ce coté là.)
Si il suffisait d'un fichier .htaccess, ce serait plus simple, mais y'a aussi du code pour l'URL rewriting dans une page.
Mon htaccess :
Code:
Options FollowSymLinks
RewriteEngine on
RewriteRule ^([^-.]+)-([0-9]+)\.html$ index.php?cat=$2 [QSA,L]
Ma page option.php (en partie)
Code:
$url_rewriting=true; // Active l'URL Rewriting
Code:
Fonction pour gerer l'URL Rewriting
*/
function url_rewrite($cat_nom,$cat_id,$p){
global $url_rewriting;
if (!$url_rewriting) return "?cat=$cat_id";// mod Non URL Rewriting
// si URL Rewriting
$cat_nom=trans_nom_fichier(substr($cat_nom,0,25));
$cat_nom=urlencode($cat_nom);
$cat_nom=str_replace("+-/.",
"_\0\0\0",$cat_nom);
return $cat_nom."-".$cat_id.".html";
}
function trans_nom_fichier($nom)
{
$nom=stripslashes($nom);
$nom=str_replace("'","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("\"","",$nom);
$nom=str_replace("&","",$nom);
$nom=str_replace(",","",$nom);
$nom=str_replace(";","",$nom);
$nom=str_replace("/","",$nom);
$nom=str_replace("\\","",$nom);
$nom=str_replace("`","",$nom);
$nom=str_replace("<","",$nom);
$nom=str_replace(">","",$nom);
$nom=str_replace(" ","_",$nom);
$nom=str_replace(":","",$nom);
$nom=str_replace("*","",$nom);
$nom=str_replace("|","",$nom);
$nom=str_replace("?","",$nom);
$nom=str_replace("é","e",$nom);
$nom=str_replace("è","e",$nom);
$nom=str_replace("ç","c",$nom);
$nom=str_replace("@","",$nom);
$nom=str_replace("â","a",$nom);
$nom=str_replace("ê","e",$nom);
$nom=str_replace("î","i",$nom);
$nom=str_replace("ô","o",$nom);
$nom=str_replace("û","u",$nom);
$nom=str_replace("ñ","n",$nom);
$nom=str_replace("ù","u",$nom);
$nom=str_replace("à","a",$nom);
$nom=str_replace("!","",$nom);
$nom=str_replace("§","",$nom);
$nom=str_replace("+","",$nom);
$nom=str_replace("^","",$nom);
$nom=str_replace("(","",$nom);
$nom=str_replace(")","",$nom);
$nom=str_replace("#","",$nom);
$nom=str_replace("=","",$nom);
$nom=str_replace("$","",$nom);
$nom=str_replace("%","",$nom);
$nom=str_replace("__","_",$nom);
// $nom = substr ($nom,0,15);
return strtolower($nom);
}
Ce qui me donne une 404...
Code:
Not Found
The requested URL /www.direct-annuaire.com/index.php was not found on this server.
Quelqu'un à un indice à me donner...?