and am not sure where it goes or how it is interpreted by the receiving code. Without a page extension (.html, .php) or a closing / indicating a directory root, where does this go and how is it handled?
Is this indicative that it is going to a pre-constructed page or is it definitely going to some form of server side language?
Regarding the 2[L] being returned, I just added a space before the [L] and now it works fine. So the only question left is on performance and how many rules is reasonable.
Options +FollowSymLinks -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(yourdomain\\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
// if you want always redirect people from domain.com to www.domain.com
RewriteRule ^c/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)? index.php?city=$1&type=$2[L]
RewriteRule ^b/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)? index.php?smthElse=$1&smthElse=$2[L]
after last rule, you should press enter to leave empty line in the end.
Chances are they are re-writing the URL and directing it to a controller of some sort. Both Apache & IIS allow the re-writing of URLs, a quick search should be fruitful.
So in this case $1 would be Houston and $2 would be restaurants correct? And I can accept any character in the set between those two slashes and it is my passed argument.
That helps to clarify it. I had read about the substitution but it’s nice to see a real example.
For example, when u have /index.php?city=houston&type=restaurants you can change this to /c/houston/restaurants by adding this code to your .htaccess files
Another question, when I read the value for the second argument, I had set it to 2 in the page and when I send it, it returned 2[L], so it is picking up the closing [L] tag.
Also, how many of these rules is it practical to write, i.e. is there a significant performance hit if you increase the number of rules? So in the range, might it be 10, 50, 200…?