0

Apache URL リダイレクト用のスクリプトを作成しています。

私は書かれる書き換え規則を研究しました。

今、私はこれを実装するための手順を知りたいです。

  1. http.conf で mod_rewrites を有効にする

    LoadModule rewrite_module modules/mod_rewrite.so 
    AddModule mod_rewrite.c
    
  2. .htaccess を作成しました

今、私は次のことを確信していません。

 1.Access rights required to do this. 

 2.The location to put .htaccess file 

 3.how to enable logs and write logs.

 4.I have two web servers.Do I have to put this in both of them.

私の書き換えルールは次のようになります。

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} old_domain\.com [NC] 
RewriteRule ^(.*)$ http://www.new_domain.com/test$1 [L,R=301]

これを実行するためのステップバイステップの手順で誰かが私を助けてくれれば良いでしょう.

4

1 に答える 1