I have a simple rewrite rule that changes something like /locations/?slug=times-square to /locations/times-square/. The same "location" can be retrieved by ID, so the following URL's all work and retrieve the same data:
/locations/?slug=times-square
/locations/?slug=108366
/locations/108366
The last one shows that my rewrite rule works fine when the slug is a number. The rule is as follows:
RewriteRule ^locations/(.+)$ locations/?slug=$1 [L]
But writing a URL as follows: /locations/times-square
gives me a 404 error, and that's obviously the one I prefer. Is wordpress redirecting this as an error before it even makes it to the rewrite rule? How can I stop this?