Magento 設置 Rewrite Url 方法。
一、apache 要加載 Rewrite 擴展模塊。
二、網站根目錄要有 .htaccess 文件。
三、Magento 後臺要設置啓用 Rewrite Url 有效。
四、(注意:重要)常常有人忘記了這個步驟。
在 Apache httpd.conf 裏面要設置目錄的屬性。
請參照下面的設置:
vi /etc/httpd/config/config.httpd
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/magento-3.com
ServerName www.magento-3.co
ErrorLog logs/magento-test.com-error_log
CustomLog logs/magento-test.com-access_log common
<Directory "/var/www/html/magento-3.com">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
請注意上述紅色字樣html