开发者

.htaccess ReWrite simple regex problem

开发者 https://www.devze.com 2023-02-22 13:01 出处:网络
I currently have this rule: RewriteRule ^Listing/([a-zA-Z]+)/([a-zA-Z]+)/([a-z0-9]+)$ He_Listed.php?city=$1&area=$2&list=$3 [NC,L]

I currently have this rule:

RewriteRule ^Listing/([a-zA-Z]+)/([a-zA-Z]+)/([a-z0-9]+)$ He_Listed.php?city=$1&area=$2&list=$3 [NC,L]

This works well for an address such as:

http://www.mysite.co.uk/Listing/UK/London/44

but doesn't for:

http://www.mysite.co.uk/Listing/UK/London_Bred/44

Because of the underscore. What change would i have to make in the above regex in order to accomplish this? The second "([a-zA-Z]+)" should be turned in开发者_StackOverflow社区to what?


should be turned from [a-zA-Z]+ to [a-zA-Z_]+

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号