Php .htaccess替换斜杠并重定向

Php .htaccess替换斜杠并重定向,php,.htaccess,mod-rewrite,redirect,Php,.htaccess,Mod Rewrite,Redirect,我需要将localhost/\u转义\u片段\=/index重定向到localhost/snapshots/index.html,以便执行我使用的操作 RewriteRule ^(.*?)_escaped_fragment_=(.*)$ /$1snapshots$2.html [L,NC,R] 但我还需要在$2中将斜杠替换为下划线,像localhost/shapshots/products/95.html这样的路径需要转换为localhost/shapshots/products_95.htm

我需要将localhost/\u转义\u片段\=/index重定向到localhost/snapshots/index.html,以便执行我使用的操作

RewriteRule ^(.*?)_escaped_fragment_=(.*)$ /$1snapshots$2.html [L,NC,R]
但我还需要在$2中将斜杠替换为下划线,像localhost/shapshots/products/95.html这样的路径需要转换为localhost/shapshots/products_95.html

怎么做


提前感谢。

为什么要下划线而不是斜杠?gruntjs使用下划线而不是斜杠为ajax站点制作快照,但这是
http://localhost/shapshots_products_95.html
有效的URL?当您打开这个URL时会发生什么?正确的方法是使用restful方式创建页面的html快照,您的评论会让人困惑。是否希望最终URL为:
http://localhost/#!/产品/95
现在?