Pour simplifier les choses tu a plusieurs choix :
Faire un fichier index.php a la base du site qui inclus les fichiers en question :
<?php
define('PREFIX', 'html/uo/html/');
if (empty($_GET['page']))
$_GET['page'] = 'accueil';
switch($_GET['page'])
{
case 'presentation':
include PREFIX.'presentation/frpresentation.html';
break;
case 'yyy':
include PREFIX.'yyy/yyy.html';
break;
case 'accueil':
default:
include PREFIX.'index.html';
}
?>
[^] # Re: passage a apache 2
Posté par Raphaël G. (site web personnel) . En réponse au message apache 1.33: afficher l'url correspondant au nom de domaine ... comment?. Évalué à 2.
Tu as ce genre d'url :
http://www.univ-ouaga.bf/html/uo/index.html ?
http://www.univ-ouaga.bf/html/uo/html/presentation/frpresent(...)
http://www.univ-ouaga.bf/html/uo/html/formations/frFormation(...)
http://www.univ-ouaga.bf/html/uo/html/inscriptions/frInscrip(...)
http://www.univ-ouaga.bf/html/uo/html/recherche/frrecherche.(...)
http://www.univ-ouaga.bf/html/uo/html/bibliotheque/frbibliot(...)
http://www.univ-ouaga.bf/html/uo/html/partenariat/frpartenar(...)
http://www.univ-ouaga.bf/html/uo/html/vieEtudiante/vie_etudi(...)
http://www.univ-ouaga.bf/html/uo/html/contact/frcontact.html
http://www.univ-ouaga.bf/html/uo/html/planDuSite/frplanDuSit(...)
http://www.univ-ouaga.bf/html/uo/html/actualites/frServiceCo(...)
Pour simplifier les choses tu a plusieurs choix :
Faire un fichier index.php a la base du site qui inclus les fichiers en question :
<?php
define('PREFIX', 'html/uo/html/');
if (empty($_GET['page']))
$_GET['page'] = 'accueil';
switch($_GET['page'])
{
case 'presentation':
include PREFIX.'presentation/frpresentation.html';
break;
case 'yyy':
include PREFIX.'yyy/yyy.html';
break;
case 'accueil':
default:
include PREFIX.'index.html';
}
?>
Ça te redemandera de ré-écrire les href de toutes tes pages pour avoir des :
http://www.univ-ouaga.bf/?page=accueil
http://www.univ-ouaga.bf/?page=presentation
http://www.univ-ouaga.bf/?page=yyy
(dans ce cas là tu te prend pas la tête avec les pages dans les sous répertoires et autre)
Après tu peux faire joujou avec mod_rewrite :
Documentroot /var/www
<Directory /var/www>
# config ici
<IfModule mod_rewrite.c>
# rewrite presentation
RewriteCond %{REQUEST_URI} ^/presentation$
RewriteRule ^/.* /var/www/html/uo/html/presentation/frpresenation.html
# rewrite accueil
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/accueil$ [OR]
RewriteCond %{REQUEST_URI} ^/index.php$ [OR]
RewriteCond %{REQUEST_URI} ^/index.html$
RewriteRule ^/.* /var/www/html/uo/html/index.html
# etc...
Du coup tes url deviennent :
http://www.univ-ouaga.bf/accueil
http://www.univ-ouaga.bf/presentation
http://www.univ-ouaga.bf/inscription
...