Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 在SPA中重写SEO规则不起作用_Apache_Seo - Fatal编程技术网

Apache 在SPA中重写SEO规则不起作用

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

我希望为我的单页应用程序网站实施SEO(假设它位于www.myexample.com)

在阅读了Google的文档()之后,我开始尝试在网站主页上使用它。 也就是说, www.myexample.com_= 应该“映射到” www.myexample.com/staticIndex.html

我将以下内容添加到网站的public_html文件夹中的.htaccess文件中:

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]