我有問題重新書寫網址從htaccess的:URL重寫本期的查詢字符串參數
http://localhost/cs/compare?slug=wash-safe-industries.html
到
http://localhost/cs/compare/wash-safe-industries.html
我曾嘗試下面的代碼在.htaccess但不起作用我也搜索了各種網站,但仍面臨問題
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?compare/(.*?)/?$ /compare.php?slug=$1 [L]
也試過下面的代碼行
RewriteRule ^cs/(.*)$ cs/compare.php?slug=$1 [L,QSA]
請幫我謝謝
@anubhava是它拋出404錯誤 –
@anubhava在cs文件夾中 –