我需要根據我在URL中給出的產品的產品ID重寫URL。例如:如何用動態ID重寫URL
http://localhost/files/eeeee/product_details?pro_id=11
http://localhost/files/eeeee/product_details/12
我曾嘗試以下,但它不工作
RewriteCond %{QUERY_STRING} ^pro_id=([0-9]*)$
RewriteRule ^product_details\.php$ /product_details/%1? [L]
通過這個。 http://stackoverflow.com/questions/43468946/rewrite-rule-in-htaccess-convert-query-string-into-slashes-php,http://stackoverflow.com/questions/36815217/replace-url-query-字符串與斜線友好的網址 –
什麼是您的控制器名稱? – ImBS
「'/ files/eeeee/product_details?pro_id = 11'」 - 大概應該是'/files/eeeee/product_details.php?pro_id = 11'?你在你的應用程序中看到了什麼網址?你的代碼片段似乎與你看起來需要的完全相反? – MrWhite