Msg#: 4605464 posted 3:44 pm on Aug 28, 2013 (gmt 0)
I'm trying to redirect any requests for thisfile.htm. The problem I have is it may be requested from several different locations since it's been moved over the years and some search engines still look for the old locations, thus throwing error log errors.
* Note the addition of the \ preceding the . [dot] which makes it match a literal . [dot] rather than any character other than the end of a line and the L flag which should always be used unless you know why you do not want it.
If the new file is the same name as the old file, then you'll need to remove the opening anchor and use a condition:
Msg#: 4605464 posted 5:40 pm on Aug 28, 2013 (gmt 0)
I thought that indicated the start of the match pattern.
It does, so ^thisfile\.htm$ will only match *exactly* http://www.example.com/thisfile.htm. By removing the start anchor from the rule *anything* preceding thisfile.htm is implicitly matched, so thisfile\.htm$ will match http://www.example.com/thisfile.htm and http://www.example.com/some-path/thisfile.htm and http://www.example.com/some-other/path/thisfile.htm and anything else that ends with thisfile.htm.