使用 Apache2 作為網頁伺服器時,尤其是 PHP Web Application,通常會使用 rewrite rule 來改寫網址,最近開 AWS 上的 Ubuntu 12.04 機器,安裝 Apache2 時 mod_rewrite 預設並非開啓的,所以我們就要自行開啓 mod_rewrite。

指令如下:

$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart

開啓後,重開 apache2 即可啓用 mod_rewrite。

Fukuball

我是林志傑,網路上常用的名字是 Fukuball。我使用 PHP 及 Python,對機器學習及區塊鏈技術感到興趣。 https://www.fukuball.com

Co-Founder / Head of Engineering at OurSong

Taipei, Taiwan