I am new to mod_rewrite and starting fairly simple. I have two URLs with the same format, but one looks for a specific first word while the other matches any word.
This rule works:
# Site ($country/$name) e.g. uk/westminster-abbey
RewriteRule ^([a-z\-]+)/([a-z\-]+)$ site.php?country=$1&name=$2 [L]
But this more specific one, with the same URL format, doesn't work (I get an Internal Server Error):
# Person (person/$name) e.g. person/winston-churchill
RewriteRule ^person/([a-z\-]+)$ person.php?name=$1 [L]
FYI, I comment out all rules except the one I'm testing, so interaction isn't the issue.
All I've done is change the first atom to match the specific word "person". Can anyone see what is wrong with it? I've looked at lots of examples online and it seems like it's the right regex format.
Maybe I should be using a conditional for this rule? But my understanding is that would be slower, and it seems the above rule should work.
This is driving me crazy! Thanks in advance for any help.