我所在的文件夾中的.htaccess文件「/混音帶/」我試圖獲取URL mydomain.com/music/downloads/mixtapes/this-title/id
執行mydomain.com/music/downloads/mixtapes/item.php?title=variable1&id=variable2
有2個變量與重寫規則「/」分隔
目前我有以下方式有點工作,但它只使用id和我需要兩個變量(../mixtapes/title/id)分開「/」和由於某種原因與下面的代碼索引頁面「/ mixtapes /」不行,我很難過!我對此有點新,任何幫助都非常感謝!
順便說一句我的索引頁路過網址item.php
頁被改寫爲<a href="title/id">
上我只是不能似乎得到它的正確格式爲mixtapes/title/id
當前htaccess文件位於「/混音帶/」執行item.php?title=a&id=b
# turn mod_rewrite engine on
RewriteEngine On
# rewrite all physical existing file or folder
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
# allow things that are certainly necessary
RewriteCond %{REQUEST_URI} "/css/" [OR]
RewriteCond %{REQUEST_URI} "/images/" [OR]
RewriteCond %{REQUEST_URI} "/images/" [OR]
RewriteCond %{REQUEST_URI} "/javascript/"
# rewrite rules
RewriteRule ^mixtapes/item.php(.*) - [L]
RewriteRule ^(.*) item.php?id=$1 [QSA]