- edit site conf (vim /etc/apache2/sites-available/pr.site.org.conf)
<VirtualHost pr.site.org:80> ServerName pr.site.org ServerAdmin webmaster@localhost DocumentRoot /var/www/pr.site.org # !-- add this section <Directory /var/www/pr.site.org> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> # !-- ErrorLog ${APACHE_LOG_DIR}/pr_error.log CustomLog ${APACHE_LOG_DIR}/pr_access.log combined </VirtualHost>
- enable apache2 rewrite module
a2enmod rewrite
- restart apache2 service
service apache2 restart
Ref.
[1] Victor Hung’s Diary: 「教學」解決 WordPress 固定網址設定 404 錯誤
[2] DigitalOcean: WordPress permalinks tried everything