htacess expression regulière/php
Bonjour,
Je n'arrive pas a mettre au point une expression régulière dans mon htacess
Mon RewriteRule:
Code:
RewriteRule ^joueur/(.*)-?([0-9]?).html$ /joueurs.php?nomJoueur=$1&p=$2 [L]
où $1 => nom du joueur
où $2 => numéro de page
Quand je tappe mon url:
Code:
http://127.0.0.1/joueur/Joueur-Luis-de-Carvalho.html
Dans ma page joueurs.php, via un $_GET j'obtient ceci:
Code:
1 2 3
| array
'nomJoueur' => string 'Joueur-Luis-de-Carvalho' (length=21)
'p' => string '' (length=0) |
=> j'obtiens bien ce que je veux
Si je tappe:
Code:
http://127.0.0.1/joueur/Joueur-Luis-de-Carvalho-5.html
Là j'obtient :
Code:
1 2 3
| array
'nomJoueur' => string 'Joueur-Luis-de-Carvalho-5' (length=23)
'p' => string '' (length=0) |
Alors que je voudrai:
Code:
1 2 3
| array
'nomJoueur' => string 'Joueur-Luis-de-Carvalho' (length=23)
'p' => string '5' (length=0) |
Pouvez-vous m'aider svp ?
Merci beaucoup