1

Could you please some one help me write a regular expression for the following requirement.

PATTERN written in apache httpd.conf

RedirectMatch ^/$ https://demo.test.com/xyz/test/DemoWelcomePage

I have rewritten a pattern to match but it failing in perl.

$FS_URL="demo.test.com"; searching the Pattern using grep - "RedirectMatch\s\^/\$\s(https\|http)\://($FS_URL).*"

Could you correct me regular expression condition.

Thanks.

4

1 に答える 1

1
^/$

その意味

^ 行頭で一致 / は、行末で /character $ 一致と一致することを意味します

そのため、/ が 1 つだけ含まれる行に一致します。

Apache のコンテキストでは、これはサイトのルート ページのみを意味します。 http://www.example.com/

サイトの他のすべてのページが一致しません

2 番目の正規表現が何を達成しようとしているのかわからない場合、perl について言及していますが、コンテキストを提供していません - 申し訳ありません

于 2013-08-05T07:58:41.040 に答える