Table of Contents
wordpress vào thì nó không đọc được file htaccess, nên không rewrite url được. https://dothanhlong.org/note-tro-domain-ve-lop-mang-sau-nat-multi-vps-multi-local-ip/ Lỗi này dẫn đến việc thay vì để url dạng
https://dothanhlong.org/?page=aboutMà rewrite để thành
https://dothanhlong.org/aboutthì nó sẽ hiểu about là một thư mục chứ không phải một tham số từ wordpress, đẫn đến báo lỗi 404.
Cách khắc phục không đọc được htaccess
Khai báo dòng sau vào cấu hình vhostAllowOverride AllCụ thể một vhost của mình sẽ như thế này
NameVirtualHost *:80 <Directory "C:/xampp/htdocs/"> AllowOverride All Order Deny,Allow Allow from all </Directory> <VirtualHost *:80> DocumentRoot "D:/WebData/hahahaha/" ServerName hahahaha.com ErrorLog "logs/hahahaha.com-error.log" CustomLog "logs/hahahaha.com-access.log" combined <Directory "D:/WebData/hahahaha/"> AllowOverride All # Order Allow,Deny Allow from all # --New way of doing it Require all granted #Options FollowSymLinks Includes ExecCGI #RewriteEngine On #RewriteBase / #RewriteRule ^index\.php$ - [L] #RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule . /index.php [L] </Directory> </VirtualHost>Kiểm tra thì wordpress đã đọc được file htaccess Done! -soiqualang_chentreu-]]>