我正在編寫Apache URL重定向腳本。如何啓用apache重寫步驟
我研究了要寫入的重寫規則。
現在我想知道實現這個過程。
在http.conf中啓用mod_rewrites
LoadModule rewrite_module modules/mod_rewrite.so AddModule mod_rewrite.c
我創建的.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]
這將是很好,如果有人幫助我一步一步的過程來執行此操作。