Tom
Tom

Reputation: 9643

.htaccess ReWrite simple regex problem

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 into what?

Upvotes: 0

Views: 97

Answers (1)

tomsv
tomsv

Reputation: 7277

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

Upvotes: 5

Related Questions