我正在創建一個基於restful的API,並堅持htaccess重寫規則。htaccess重寫爲寧靜api
我目前使用這樣的:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !(.*)\.(css|js|htc|pdf|jpg|jpeg|gif|png|ico)$ [NC]
RewriteRule ^(.*)$ index.php?handler=$1 [QSA,L]
</IfModule>
其中一期工程,但是我希望它排除的文件擴展名的目錄和當前的排除不有所作爲。
E.g.
- /API /對象/ 1 /列表是有效
- /api/object/test.php/js/css等。無效
感謝。