如何做一个特定的条件escaped_fragment用在.htaccess重写规则 [英] How to do a specific condition for escaped_fragment with rewrite rule in .htaccess

查看:209
本文介绍了如何做一个特定的条件escaped_fragment用在.htaccess重写规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的网址 /#/第1页,我重定向他们:

I have urls like that /#!/page1, I redirect them with :

  RewriteCond %{QUERY_STRING} ^_escaped_fragment_=%2F(.*)$
  RewriteRule ^$ /seo/%1.html [QSA,L]

所以 /#!/第1页读作 / _ escaped_fragment _ =%2Fpage1 将被重定向到 /seo/page1.html

这是工作完美,但是我想重定向家 /#!/ /seo/index.html 这实际上重定向到 /seo/.html

It's work perfectly however I want to redirect the home /#!/ to /seo/index.html which actually redirect to /seo/.html

我怎样才能做到这一点?
谢谢

How can I do that? Thanks

推荐答案

我有固定的:

 RewriteCond %{QUERY_STRING} ^_escaped_fragment_=%2F$
 RewriteRule ^$ /seo/index.html [QSA,L]

 RewriteCond %{QUERY_STRING} ^_escaped_fragment_=%2F(.*)$
 RewriteRule ^$ /seo/%1.html [QSA,L]

这篇关于如何做一个特定的条件escaped_fragment用在.htaccess重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆