跳至主要內容

文章

顯示包含「Drupal」標籤的文章

[Drupal] 設定Clean URLs

安裝了Drupal 8,顯示了下面這行 Your server is capable of using clean URLs, but it is not enabled. Using clean URLs gives an improved user experience and is recommended. 簡單來說,就是系統沒有開啟Clean URLS的功能 去查了一下 這功能跟Apache的一個模組有關 要先去安裝此模組再做設定 這跟a2enmod rewrite 有關,不需要另外安裝,只需要下以下指令開啟 sudo a2enmod rewrite 開啟後 重啟apache2,2種指令,挑一種就行 sudo service apache2 restart sudo /etc/init.d/apache2 restart 想知道有沒有開啟的話,到 cd /etc/apache2/mods-enable 如果有 rewrite.load 就是成功了 不過我們不只是要開啟這個模組,還要設定Clean URLs 到 /etc/apache2/apache2.conf 找到 把 AllowOverride None 改成 AllowOverride All 儲存後 重新restart apache2就可以了 參考來源 Clean URLs with Apache 2 on Ubuntu Ubuntu 如何設定 Drupal 的簡潔網址( Clean URL) ? Ubuntu 如何安裝和啟用 Apache 的 rewrite 模組 ? Drupal 8 install warn, Clean Urls Disabled while it is enabled