Re: Search engine friendly urls
Try:
RewriteRule ^/services/([a-zA-Z0-9\-]*)$ /services.php?id=$1 [L]
The dash is a reserved character and usually needs to be escaped with a backslash.
You also still need to have the parentheses. That is how mod_rewrite knows which part of the original string to use to replace the $1.
Also, you need to tell mod_rewrite how many characters to match. The brackets will only match a single character that matches the range of possible characters listed. Adding the asterisk after the closing bracket tells it to match as many characters as there are.
__________________
The best way to learn anything, is to question everything.
Last edited by wige; 11-26-2008 at 06:39 PM.
|