Possible Duplicate:
.htacces to create friendly URLs. Help needed
I am new to url rewritting so here’s my query
I have a site http://www.mysite.com/ichat now if a request comes like `http://www.mysite.com/ichat/a2b35‘
I want to redirect it to a php file in my server in the ichat directory as under
http://www.mysite.com/ichat/chat.php?chatid=a2b35
but if the url is like this
`http://www.mysite.com/ichat/special/a2b35‘
i want to redirect it to
http://www.mysite.com/ichat/chat.php?special=yes&chatid=a2b35
the chatid will be alphanumeric without special characters. Is this redirection possible or i need a physical special folder for this to work?
Sure, just take advantage of the fact that rewrites are ordered in evaluation:
The
[L]means that rule evaluation will stop at the rule if it matches it, so any/ichat/special/url will get caught by the first rule, and the other/ichat/urls will get caught by the second.