Trying to create a .htaccess RewriteRule that will map
question.php?1 to query?number=1
but niether of the following ways to deal with the '?' (question mark) work:
RewriteRule ^question \.php\?1$ query?number=$1
RewriteRule ^question \.php$?^([0-9])$ query?number=$1
How do I deal with the question mark in the pattern without having the regular expression mistake the '?' in the URL as the ? operator?
Thank you.
Dealing with question marks????????
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Code: Select all
"/\? \(escape it\)/"- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Code: Select all
RewriteRule ^question \.php\?1$ query\?number=$1- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
RewriteRule ^question\.php\?([0-9]+)$ query?number=$1You pretty much had it right although needed to add a backslash before "?" on the left and also remove some carets and dollars