对目录

时间:2016-04-04 09:39:12

标签: php apache .htaccess mod-rewrite regex-negation

我希望在网址中的目录之后对所有请求进行重写,但我不知道如何做到这一点。

基本上寻找:

url.com/directory/anything/after/the/directory /

因此,如果有任何请求com到url.com/directory/,无论后面发生什么,都会被重定向回目录之前的索引(即。url.com)

我尝试使用正则表达式:/ forex /.?(.*)

但我真的没有到达任何地方。

任何人都可以踢我正确的方向。我本质上是为了:

RewriteRule \/forex\/.?(.*) inxe.php

但这并没有奏效。

感谢所有回复,谢谢!

2 个答案:

答案 0 :(得分:1)

在任何规则之前,请确保在

上编写RewriteEngine

答案 1 :(得分:0)

尝试:

setStyle(DialogFragment.STYLE_NORMAL, 0);

这将重定向

  • / dir / foo / bar(目录索引文件除外)

  • 的index.php
相关问题