问题
Hello today i tried to rewrite few things, i tried to rewrite this:
www.example.com/index.php?title=how+do+man+live?
To:
www.example.com/posts/how+do+man+live?/
Now the problem is that the question mark appears only at url and when i post the $_GET variable(title..) its post everything but not the question mark.
i tried put in rewrite mdoe this:
RewriteRule post/([0-9א-בa-zA-Z+.`?]+)/?$ index.php?title=$1 [NC]
course that the Rewrite engine is on. thank you guys, have wonderful day!
回答1:
You need to capture this value from THE_REQUEST
variable to be able to capture ?
also. Use this rule in root .htaccess:
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+posts/(\S+) [NC]
RewriteRule ^ index.php?title=%1 [L,QSA]
来源:https://stackoverflow.com/questions/26433965/htaccess-question-mark-allowing