开发者

.htaccess not redirecting to ?_escaped_fragment_=

I want to redirect the request "index.php?_escaped_fragment_=about" to "snapshots/snap_about.html" but I can't get it to work :(

It's an AJAX site; the URL I receive when I try to request example.com/index.php?_escaped_fragment_=about is:

example.com/index.php?_escaped_fragment_=about#!about

This开发者_运维问答 is my htaccess

redirect index.php?_escaped_fragment_=about http://www.example.com/snapshots/snap_about.html
redirect  /testx.html http://example.com/dummytest/index.html

The redirect /testx.html works.

Maybe I am making a big big mistake, but I am new at this!


I'd probably do this using a RewriteRule. Is this a one-off, or is it a general pattern that could be applied to other URLs? e.g. would you also want index.php?_escaped_fragment_=blah to redirect to snapshots/snap_blah.html?

If not, something like this:

RewriteRule index\.php\?_escaped_fragment_=about  snapshots/snap_about.html [NC,R=301]

If yes, something like:

RewriteRule index\.php\?_escaped_fragment_=(.*)  snapshots/snap_$1.html [NC,R=301]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜