Reputation: 1045
I've used a url rewrite in the htaccess file to show 2 query string values as /item1/item2
When I get item2 it has .php at the end. Is there something I'm missing on my rewrite?
Get call
$card = $_GET['card'];
$card; // This value has .php after the value
Rewrite
RewriteRule ^player-score\/([^\/]+)\/([^\/]+)\/? /player-score.php?id=$1&card=$2 [QSA,NC,L]
Fully example URL
www.example.com/player-score.php?id=1&card=45
Upvotes: 2
Views: 135
Reputation: 1045
I found the issue, I need to move the rule below underneath my query string rewrite rule:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Upvotes: 1
Reputation: 2153
Can you try this. I have made minor edit to your rewrite.
RewriteRule ^player-score/([^/.]+)/([^/.]+)/?$ player-score.php?id=$1&card=$2 [QSA,NC,L]
Upvotes: 0
Reputation: 41219
Try this rule :
RewriteRule ^player-score/([^\/]+)/([^/.]+)/?$ /player-score.php?id=$1&card=$2 [QSA,NC,L]
Upvotes: 0