htaccess file mod_rewrite issue

烈酒焚心 提交于 2019-12-12 04:16:07

问题


Basically this is my structure:

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

/api
 - api.php

Basicly what im trying to do is to map requests to localhost/api/ to go to localhost/api/api.php

I have tried with the following with no results:

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

Can anyone help me?

Summary: Right now when making http requests I have to set baseUrl to api/api.php/###

I want to to be reached through api/###

来源:https://stackoverflow.com/questions/35466306/htaccess-file-mod-rewrite-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!