我想知道如何使用mod rewrite將不具有尾部斜槓的第一級子文件夾重寫爲php文件。重寫沒有結尾斜槓的第一級子文件夾htaccess
例如
/test -> rewrites to file.php?id=test
/test/ -> trailing slash so it follows through as normal to /test/
/test/test -> second level sub folder so it follows through as normal to /test/test
/ -> homepage needs to follow through as usual to index.php
試圖想一個規則,1號線要做到這一點的。對於上面的例子,測試只是一個例子,規則應該重寫任何字符串。