Apache 2.4でエイリアスを使用してmod_rewriteを設定する方法は?

Apache 2.4でエイリアスを使用してmod_rewriteを設定する方法は?

AliasでApache mod_rewriteを使用する方法は?次のファイルを含むテストディレクトリがあります。 Correct.html index.html test_httpd.conf error.html error.htmlへの要求をCorrect.htmlにリダイレクトするエイリアスを使用するサンプルルールが必要です。別の例のルールは、 test ディレクトリ内のすべてのファイルに対する要求を Correct.html に渡します。以下はtest_httpd.confで試したものです。

#DocumentRoot /var/www/localhost/htdocs/test
Alias /test /var/www/localhost/htdocs/test/
#<Directory /var/www/localhost/htdocs/test>
#<Directory /test>
<Directory test>
  RewriteEngine On
  #RewriteRule ^*$ rewriteme.html [R]
  RewriteRule ^wrong.html$ correct.html [R]
</Directory>

私はGentooでApache 2.4.6-r2を使用しています。

ベストアンサー1

おすすめ記事