I'm writing php script for a magazine. I want visitors to access issues in the following format:
For example: magdomain.com/6/2005/t-34
The .htaccess I came up with looks like the following:
RewriteRule ^(.*)/(.*)/(.*)$ mag.php?d=$1/$2&p=$3
It works except in two cases:
1) The visitor types magdomain.com/6/2005 without backslash after 2005
2) The visitor is not typing issue's date after the domain, e.g. magdomain.com or magdomain.com/ only
RewriteRule ^(.*)/(.*)/(.*) mag.php?d=$1/$2&p=$3 [L]
(without $ at the end of the matching-pattern).
And if the visitor doesn't type issue's date, what do you expect to happen? The rule is not matched (and can't be in any sense, how can you determine issue's date if NOTHING has been inputted), so move on th next rule (which probably isn't set).
You might want to refine your regexp, since it will match any string-combination instead of int - int - string combination.