Version stable, aprelic, connexion CFRS et autres corrections
This commit is contained in:
1 parent
865de8a976
commit
e9d0010451
62 files changed
+17483
-7256
No files matched your search
+82
-22
@@ -1,29 +1,30 @@
|
||||
<?php
|
||||
// Évite la boucle quand router.php inclut la page
|
||||
if (defined('ROUTED_PRETTY')) return;
|
||||
if (defined('ROUTED_PRETTY')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Mapping vilain -> joli
|
||||
$UGLY_TO_PRETTY = [
|
||||
//racine
|
||||
'/index.php' => '/',
|
||||
'/result_search.php' => '/recherche',
|
||||
'/detail_public.php' => '/specialistes',
|
||||
'/connexion.php' => '/login',
|
||||
'/choix_inscr.php' => '/choix-inscription',
|
||||
'/inscription_client.php' => '/inscription-client',
|
||||
'/inscription_praticien.php' => '/inscription-praticien',
|
||||
'/mdp_oublie.php' => '/mot-de-passe-oublie',
|
||||
'/avis_public.php' => '/avis',
|
||||
'/index.php' => '/',
|
||||
'/detail_public.php' => '/specialistes',
|
||||
'/connexion.php' => '/login',
|
||||
'/choix_inscr.php' => '/choix-inscription',
|
||||
'/inscription_client.php' => '/inscription-client',
|
||||
'/inscription_praticien.php' => '/inscription-praticien',
|
||||
'/mdp_oublie.php' => '/mot-de-passe-oublie',
|
||||
'/avis_public.php' => '/avis',
|
||||
//dossier client
|
||||
'/public/client/informations.php' => '/profil',
|
||||
'/public/client/modifier.php' => '/modifier-profil',
|
||||
'/public/client/compte.php' => '/mon-compte',
|
||||
'/public/client/list_praticien.php' => '/trouver-specialistes',
|
||||
'/public/client/mes_favori.php' => '/mes-preferences',
|
||||
'/public/client/detail_praticien.php' => '/specialiste',
|
||||
'/public/client/avis.php' => '/donner-avis',
|
||||
'/public/client/reserver_rdv.php' => '/reservation',
|
||||
'/public/client/mes_rendez_vous.php' => '/mes-rendez-vous',
|
||||
'/public/client/informations.php' => '/profil',
|
||||
'/public/client/modifier.php' => '/modifier-profil',
|
||||
'/public/client/compte.php' => '/mon-compte',
|
||||
'/public/client/list_praticien.php' => '/trouver-specialistes',
|
||||
'/public/client/mes_favori.php' => '/mes-preferences',
|
||||
'/public/client/detail_praticien.php' => '/specialiste',
|
||||
'/public/client/avis.php' => '/donner-avis',
|
||||
'/public/client/reserver_rdv.php' => '/reservation',
|
||||
'/public/client/mes_rendez_vous.php' => '/mes-rendez-vous',
|
||||
|
||||
//Dossier praticien
|
||||
'/public/praticien/informations.php' => '/profil-pro',
|
||||
@@ -37,15 +38,74 @@ $UGLY_TO_PRETTY = [
|
||||
'/public/praticien/synchronisation.php' => '/connecter-agenda',
|
||||
'/public/praticien/resiliation.php' => '/abonnement',
|
||||
'/public/praticien/factures.php' => '/mes-factures',
|
||||
|
||||
|
||||
//Dossier messages
|
||||
|
||||
|
||||
];
|
||||
|
||||
// Debug : ajouter ?_noredir=1 pour désactiver la redirection
|
||||
if (!empty($_GET['_noredir'])) return;
|
||||
if (! empty($_GET['_noredir'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '/';
|
||||
require_once __DIR__ . '/search_helpers.php';
|
||||
|
||||
// Redirection SEO pour result_search.php
|
||||
if ($path === '/result_search.php' || $path === '/recherche') {
|
||||
if (! empty($_GET['ajax'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$specialite = trim((string) ($_GET['specialite'] ?? ''));
|
||||
$ville = trim((string) ($_GET['ville'] ?? ''));
|
||||
|
||||
if ($specialite !== '' || $ville !== '') {
|
||||
$target = '/recherche';
|
||||
|
||||
$specSlug = '';
|
||||
if ($specialite === '__OTHERS__') {
|
||||
$specSlug = 'autres-specialistes';
|
||||
} elseif ($specialite !== '') {
|
||||
$specSlug = seo_spec_slug_from_input($specialite) ?? '';
|
||||
}
|
||||
|
||||
if ($specSlug !== '') {
|
||||
$target .= '/' . rawurlencode($specSlug);
|
||||
}
|
||||
|
||||
$citySlug = '';
|
||||
if ($ville !== '') {
|
||||
$citySlug = seo_city_slug_from_input($ville);
|
||||
}
|
||||
|
||||
if ($citySlug !== '') {
|
||||
if ($specSlug === '') {
|
||||
// si ville seule, on garde la query string pour éviter une structure bancale
|
||||
$target = '/recherche/?' . http_build_query([
|
||||
'specialite' => $specialite,
|
||||
'ville' => $ville,
|
||||
]);
|
||||
header('Location: ' . $target, true, 301);
|
||||
exit;
|
||||
}
|
||||
|
||||
$target .= '/' . rawurlencode($citySlug);
|
||||
}
|
||||
|
||||
$target .= '/';
|
||||
|
||||
$extra = $_GET;
|
||||
unset($extra['specialite'], $extra['ville']);
|
||||
|
||||
if (! empty($extra)) {
|
||||
$target .= '?' . http_build_query($extra);
|
||||
}
|
||||
|
||||
header('Location: ' . $target, true, 301);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($UGLY_TO_PRETTY[$path])) {
|
||||
$target = $UGLY_TO_PRETTY[$path];
|
||||
|
||||
Reference in new issue
Block a user