Apache 在SPA中重写SEO规则不起作用
我希望为我的单页应用程序网站实施SEO(假设它位于www.myexample.com) 在阅读了Google的文档()之后,我开始尝试在网站主页上使用它。 也就是说, www.myexample.com_= 应该“映射到” www.myexample.com/staticIndex.html 我将以下内容添加到网站的public_html文件夹中的.htaccess文件中:Apache 在SPA中重写SEO规则不起作用,apache,seo,Apache,Seo,我希望为我的单页应用程序网站实施SEO(假设它位于www.myexample.com) 在阅读了Google的文档()之后,我开始尝试在网站主页上使用它。 也就是说, www.myexample.com_= 应该“映射到” www.myexample.com/staticIndex.html 我将以下内容添加到网站的public_html文件夹中的.htaccess文件中: RewriteEngine on RewriteCond %{QUERY_STRING} ^_escaped_fragme
RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=
RewriteRule ^_escaped_fragment_= /staticIndex.html [PT]
在这一更改之后,当我在浏览器中尝试URL www.myexample.com?\u转义\u片段时,我希望浏览器显示文件staticIndex.html的内容
相反,它向我显示www.myexample.com(index.html)的内容,浏览器URL保持不变,为www.myexample.com?\u转义\u片段_=
有人能帮我修改一下规则吗
谢谢。试试这个:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=$
RewriteRule (.*) staticIndex.html [PT]