2016-03-05 59 views
0

我有一个基于angularJs的投资组合,Google抓取工具为类似的平台提供了一个URI工具。将#!替换为?_escaped_fragment_=,您可以使用服务器重定向更改目录以提供静态文件。我不使用#!,所以?_escaped_fragment_=将在最后插入。我喜欢做的就是让这种模式:.htaccess重定向SEO配置

www.mywebsite.com/?_escaped_fragment_= 
www.mywebsite.com/page/?_escaped_fragment_= 
www.mywebsite.com/page/5?_escaped_fragment_= 

重定向到

www.mywebsite.com/snapshot 
www.mywebsite.com/snapshot/page/ 
www.mywebsite.com/snapshot/page/5 

这是我使用.htaccess文件:

RewriteEngine On 
    RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$ 
    RewriteRule ^$ /snapshot/ 
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] 
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d 
    RewriteRule^- [L] 
    RewriteRule^/index.html 

的问题是,它仅适用于基本网址(index.html)。 有没有我失踪的东西? 谢谢。

回答