%23
is the URL encoded representation of #
. I suspect your rewrite rules will not satisfy %23
. You ought to investigate how the response is being constructed. Specifically, any URL encoding functions.
However, it would be possible to solve your issue with a rewrite rule. Understand that you'll be returning two responses to the client after a comment is submitted. This is why it is preferable to correct the first response.
# http://example.org/foo-bar/%23comment-570630 -> http://example.org/foo-bar/#comment-570630
RewriteCond %{REQUEST_URI} %23comment-d+$
RewriteRule (.+)/%23-comment(d+)$ http://host/$1/#comment-$2 [R=301]
It's untested, but should work (I'm unsure about escaping \%
as it has special meaning in mod_rewrite).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…