htaccess文件mod_rewrite问题

时间:2016-02-17 19:47:35

标签: php .htaccess mod-rewrite

基本上这是我的结构:

/
 - index.html
 - js files ( the ones making http requests to /api/

/api
 - api.php

基本上我想做的是将请求映射到localhost / api /转到localhost / api / api.php

我尝试了以下但没有结果:

RewriteEngine On
RewriteBase /api/
RewriteRule ^/?(api)/? /api/api.php [NC]
RewriteCond %{REQUEST_METHOD} (PUT|DELETE)
RewriteRule .* /api/api.php

任何人都可以帮助我吗?

摘要:现在在发出http请求时我必须将baseUrl设置为api / api.php / ###

我希望通过api / ###

与我联系

0 个答案:

没有答案