I am trying to write a rewrite rule in .htaccess. It has been working fine till now. But today, I tried to write a rule and I have special character (-) in the variable. Something like this
KU0-QMV-882Q is the Variable.
My rewrite rule is as follows
# This Directive will make Apache look first
RewriteRule ^orders/pending$ orders.php?type=pending
RewriteRule ^orders/completed$ orders.php?type=completed
RewriteRule ^logout$ logout.php
RewriteRule ^login$ login.php
RewriteRule ^ticket/open$ open-ticket.php
RewriteRule ^order/view/(\w+)$ show-order-details.php?id=$1
RewriteRule ^ticket/update/(\w+)$ update-ticket.php?ticket_no=$1
Now when I try to access the URL it gives a 404 NOt Found Error.
So what do I need to write in the .htaccess file?
Thanks in advance for your help.
In your rule
\w+ means every letters, digits and underscore but not hyphen. You should use