2011-08-03 8 views
0

vhostファイルの次のディレクティブは、.htaccessファイルがない場合に正常に動作します。しかし、私がそれを紹介するとき、それは働くことを止める。 htaccess書き換えがnot-matchedの場合に、vhost書き換えを実行するにはどうすればよいですか? vhost.confからディレクトリレベル.htaccess vhost書き換えをmod_rewriteが停止します

# Skip everything except html and json 
RewriteCond %{REQUEST_URI} \..+$ 
RewriteCond %{REQUEST_URI} !\.(html|json)$ 
RewriteRule .* - [L] 
# If html exists (is cached) 
RewriteRule ^$ index.html [QSA] 
RewriteRule ^([^.]+)$ $1.html [QSA] 
# Otherwise pass it on the index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php [QSA,L] 

/test/.htaccessから:/test/hello.json ...
ため

RewriteEngine on 
RewriteCond %{REQUEST_URI} old_directory/.*$ 
RewriteRule (.*)$ old_missing.phtml [PT] 

要求... .htaccessなし:index.phpにルーティングし、正しいJSONを返しています。 .htaccess
...:.htaccessなし...
... /text/old_hello.phtmlため404 Not Found

要求を返します。.htaccessで... 404 Not Found
を返します。またold_missing.phtml

の内容を返します。私は書き換えログを書きましたが、.htaccessのルール(trip per-dir prefixapplying patternRewriteCond => not-matched、およびpass through)を使用している必要があるようですが、それだけで停止します。

「なぜあなたはこれをやっているのですか? 1)私は払い戻しをしています2)いくつかのajax .phtmlリクエストを新しいajax .jsonシステムに移行していますので、ユーザーがold_directoryのファイルを要求している場合は最初にメッセージを渡す必要があります変更。ありがとう。

答えて

関連する問題