开发者

.htaccess not redirecting to ?_escaped_fragment_=

开发者 https://www.devze.com 2023-02-21 04:51 出处:网络
I want to redirect the request \"index.php?_escaped_fragment_=about\" to \"snapshots/snap_about.html\"

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

精彩评论

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