0

My current directory structure is /www/<project> which maps to localhost/<project>. What I would like to do is load localhost/<project> with /www/<project>/dist ONLY if a dist directory exists in the project directory. How can I do this with within .htaccess assuming rewrite is turned on?

4

1 に答える 1

0

RewriteCondを使用して、ファイルまたはディレクトリが存在するかどうかをテストできます。

さまざまなファイル属性テストを実行できます。

'-d' (ディレクトリ)

TestString をパス名として扱い、それが存在するかどうか、およびディレクトリであるかどうかをテストします。

'-f' (通常のファイル)

TestString をパス名として扱い、それが存在するかどうかをテストし、通常のファイルです。

于 2013-05-23T17:53:04.000 に答える