Suivez les fils RSS
 

Des livres incontournables pour tout maîtriser

  • CSS avancées - vers HTML5 et CSS3
  • HTML5
  • CSS2
  • PHP5 avanc�
  • Memento MySQL
  • Memento CSS 3
  • Memento XHTML
  • WordPress 3 100% pratique
  • jQuery et jQuery UI
Auteur
fanny95
#
Citer
143 Posts
Bonsoir à tous,

Comme indique le titre, je n'arrive pas à faire fonctionner ensemble les 2 lignes ci-dessous.

La première me permet d'avoir une url du style "domaine.fr/categorie/news" où news est intégrée dans ma variable $var en GET.

La seconde me permet d'avoir une traduction de la page dans la langue souhaitée : "domaine.fr/en/photos" où "en" est stockée dans ma variable $lang.

Mais lorsqu'une fonctionne, l'autre ne fonctionne plus et cela me redirige vers ma page Erreur 404.

Voici mon code htaccess pour mieux comprendre :

RewriteEngine On
RewriteBase /
ErrorDocument 404  http://localhost/fan/erreur-404
 
DirectoryIndex vues/accueil.php
RewriteRule ^([a-z0-9-]+)$   	 http://localhost/fan/vues/$1.php  [L]
RewriteRule ^categorie/([a-z]+)$	 http://localhost/fan/vues/categorie.php?var=$1  [L]
RewriteRule ^([a-z]+)/([a-z]+)$	 http://localhost/fan/vues/$2.php?lang=$1  [L]


Comment réussir à faire fonctionner les deux en même temps ?
Quelqu'un aurait-il une idée svp ?
Modifié par fanny95 (20 Nov 2011 - 12:23)

http://www.netpom.fr 
^
jb_gfx
#
Citer
2853 Posts
Et si tu mets ta ligne numéro deux en premier ?


RewriteRule ^categorie/([a-z]+)$	  http://localhost/fan/vues/categorie.php?var=$1   [L]

RewriteRule ^([a-z0-9-]+)$   	  http://localhost/fan/vues/$1.php   [L]

RewriteRule ^([a-z]+)/([a-z]+)$	  http://localhost/fan/vues/$2.php?lang=$1   [L]


Je ne sais pas si je suis cultivé ou si je viens d'inventer deux nouveaux mots.

http://www.pixemedia.com/ 
^
fanny95
#
Citer
143 Posts
Ça fonctionne ! Merci.


RewriteRule ^([a-z-]+)/cat/([a-z]+)$	 http://localhost/fan/vues/cat.php?var=$2&lang=$1  [L]
RewriteRule ^([a-z0-9-]+)$   		 http://localhost/fan/vues/$1.php  [L]
RewriteRule ^([a-z-]+)/([a-z-]+)$		 http://localhost/fan/vues/$2.php?lang=$1  [L]

Modifié par fanny95 (21 Nov 2011 - 10:50)

http://www.netpom.fr 
^