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)。 有沒有我失蹤的東西? 謝謝。