使用 Prettyfaces 使用 301 重定向首页
Redirect front page with 301 using Prettyfaces
我使用 jsf 2.2 & prettyfaces-jsf 2-3.3.3 并且有 /pages/index.xhtml
页面。
我尝试像这样从首页重定向到另一个页面:
<rewrite match="/" url="http://somesite.net" redirect="301" />
当然,所有页面都被重定向了。仅重定向首页的正确方法是什么?
match
属性是一个正则表达式。所以你应该尝试这样的事情:
<rewrite match="^/$" url="http://somesite.net" redirect="301" />
我使用 jsf 2.2 & prettyfaces-jsf 2-3.3.3 并且有 /pages/index.xhtml
页面。
我尝试像这样从首页重定向到另一个页面:
<rewrite match="/" url="http://somesite.net" redirect="301" />
当然,所有页面都被重定向了。仅重定向首页的正确方法是什么?
match
属性是一个正则表达式。所以你应该尝试这样的事情:
<rewrite match="^/$" url="http://somesite.net" redirect="301" />