【发布时间】:2017-01-03 19:23:02
【问题描述】:
给定一个域:
http://example.com
使用 .htaccess 文件,我想将所有 URL 重定向到 http://example.com/dummypage.html,除了那些包含模式“a1”、“b1”和“c1”的 URL。例如:
http://example.com
http://example.com/d1
将被重定向。但是
http://example.com/a1
http://example.com/b1
http://example.com/c1
http://example.com/a1/anything/...
http://example.com/b1/anything/...
http://example.com/c1/anything/...
不应重定向。我尝试按照堆栈溢出中给出的其他答案来编写规则,但没有成功。应该注意,其他 RewriteCond 和 RewriteRule 语句已经在 .htaccess 文件中声明。因此,我不知道它们是否会影响重定向结果。 .htaccess 文件是这样的:https://docs.joomla.org/Preconfigured_htaccess
【问题讨论】: