參考:
apache RewriteRule RewriteCond介紹
Rewrite Flag介紹
#a2enmod rewrite 

#service apache2 restart
#vi /etc/apache2/apache2.conf
===================

<Directory /var/www/>
Options Indexes FollowSymLinks

AllowOverride all
Require all granted
</Directory>

===================

#vi /var/www/.htaccess
===================

RewriteEngine On
RewriteBase /

Redirect 303 /two http://www.kimo.com.tw

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
//如果要連的不是目錄也不是檔案
//則導向index.html

===================

http://[你的Server IP]/two會連往
http://www.kimo.com.tw

Apache 2.4就不再有RewriteLog以及RewriteLogLevel指令了
RewriteLog統一到ErrorLog
#vi /etc/apache2/apache2.conf
===================
LogLevel warn mod_rewrite.c:trace4
===================
#service apache2 restart
就可以看到Rewrite記錄

文章標籤
全站熱搜
創作者介紹
創作者 slinbody 的頭像
slinbody

495884965

slinbody 發表在 痞客邦 留言(0) 人氣(50)