I have the following RewriteRule in my .htaccess file.
RewriteRule ^news/[a-z]+/([-a-z0-9]+)/$ http://localhost/story/$1/ [R=301]
Its purpose is to send requests for
http://localhost/news/category/story-title/
to http://localhost/story/story-title/
And it works fine for that purpose, but the problem is that if I have a link to http://localhost/news/category/ that link is now broken, because it's also trying to do a redirect on that.
I've tested the above regex in several testing tools, and according to all of them, it should not be seeing news/category/ as a match, and yet on the server that's exactly what it seems to be doing. What can I do to fix this?


Reply With Quote



Yeah, sorry, a pet peeve of mine (as you're well aware).
Bookmarks