0
我正在使用商業目錄網站。我想要做的是改變的URL字符串: http://www.website.co.uk/business/results.php?category_id=11使用mod_rewrite將單詞放入URL而不是類別ID
要http://www.website.co.uk/business/Financial &法律
如何實現這一目標?不太確定我會使用「重寫規則」等。
感謝您的任何幫助,提前。
我現在試圖在本地主機上測試一下。
的HTML代碼如下:
<h1>This is the PHP file.</h1>
<a href="index.php?url=category">Link Here</a>
因此,所有我想要的是網址http://localhost/mod_rewrite/index.php/category 而不是:http://localhost/mod_rewrite/index.php?url=category
的.htaccess文件如下(但犯規出現工作)?
RewriteEngine on
RewriteRule ^([^/\.]+)/?$ /index.php?url=$1 [L]
歡呼聲中,我給它在該主一展身手 – StuBlackett 2011-02-15 10:47:19