あなたvirtualhost
& DocumentRoot
を設定している場合は、あなたのDocumentRootのためにしなければならないのは、次のとおりです。あなたのDocumentRoot
に存在するあなたのあたりディレクトリ.htaccess
で
RewriteBase/
。
他のフォルダの場合はmod_alias
ディレクティブAlias
(コンテキスト:サーバー設定、仮想ホスト)を設定する必要があります。
例:
エイリアス/ XYZ/ABC/DEF
から自分のディレクトリごと.htaccess
例でRewriteBase
ディレクティブを使用:RewriteBase
:
# /abc/def/.htaccess -- per-dir config file for directory /abc/def
# Remember: /abc/def is the physical path of /xyz, i.e., the server
# has a 'Alias /xyz /abc/def' directive e.g.
#
RewriteEngine On
# let the server know that we were reached via /xyz and not
# via the physical path prefix /abc/def
RewriteBase /xyz
# now the rewriting rules
RewriteRule ^oldstuff\.html$ newstuff.html
チェックリダイレクトサンプルのこのページ.htaccessファイルを使用して:http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#redirects – Diego