site.com/a-to-z -Displays info-a-to-z.php
site.com/a-to-z/a-to-c -Displays info-a-to-z-2.php
If you want that, then your .htaccess is really wrong.
Change the second RewriteRule to
RewriteRule ^a-to-z[COLOR="Red"]/[/COLOR]a-to-c /info-a-to-z-2.php
If you want /a-to-z and a only /a-to-z to display info-a-to-z.php then you need to add an end anchor ($) to the RewriteRule, like so:
RewriteRule ^a-to-z$ info-a-to-z.php [L]
I already told you this in my previous post btw. This also holds for the a-to-z/a-to-c rule btw.
Ah yes, the infamous Last flag (I do agree, the name is a bit weird, but I wouldn’t know of a better for that odd fellah either).
The first thing you need to know is that mod_rewrite works in rounds. So, when a user requests a URL, Apache will work through all the RewriteRules to see if any of them matches. If one of them does, it will go on trying to process all of the remaining rules.
When all rules are processed, and the URL was rewritten as a result of that round, a new round will start. This will continue until the URL is not rewritten by any of the rules.
For the example of your RewriteRules, the two rules you have are mutually exlusive (or rather, the rules you should have, the rules you currently have are not). That means that if the first rule matches, the second rule will never match, and vice versa.
So, suppose a user requests the URL that is matched by the first rule. The URL will be rewritten, and Apache will try to match the second rule. But, seeing as the rules are mutually exclusive, this second rule will not match, and Apache is testing it for nothing. Of course the rule won’t match, and Apache will start the second round, which won’t do anything and we’re done.
Now, suppose you had the Last [L] flag on the first RewriteRule and again a user is requesting the URL that is matched by that first RewriteRule.
What will happen now is that the first rule matches, Apache will encounter the [L] flag and stop the current round and start a new round.
That means that it won’t check the second rule in the first round, which is nice, because we already knew that wouldn’t match.
In short, you need to add a Last flag to any rules that are mutually exclusive.
An example of where you don’t want to use the last flag:
RewriteEngine On
RewriteRule ^foo$ bar
RewriteRule ^bar$ blah
I’ll leave it up to you to decide why I wouldn’t want to use a Last flag here, and brownie points if you know when using two rules like above would be useful 