在/var/www/html 建立 .htaccess
加入以下內容
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
修改apache2.conf
/etc/apache2/apache2.conf
加入以下內容<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>重新啟動Apache2
sudo a2enmod rewritesudo service apache2 restart
沒有留言:
張貼留言