简体   繁体   中英

Accept question mark on .htaccess

I want to accept the question mark on my URL like this:

http://www.example.com/page/url-example-?-15

I use this .htaccess file:

RewriteRule page/([a-zA-Z0-9éèÉàêç\-\"\'\(\)\:\!\?]+)-([0-9]+) page.php?url=$1&Id=$2

All characters work except the question mark, how can I resolve this?

<?php

  preg_match("/([a-zA-Z0-9éèÉàêç\-\"\'\(\)\:\!\?]+)-([0-9]+)/", 
             "url-example-?-15", 
             $matches, 
             PREG_OFFSET_CAPTURE);

  print_r($matches);

?>

 body, html, iframe { width: 100% ; height: 100% ; overflow: hidden ; } 
 <iframe src="https://ideone.com/1yr1ec"></iframe> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM