0

我对 .htaccess 的 url 有疑问。我需要所有的网址,例如: http: //mywebsite.com/api/something转到我的 api/index.php 因为我需要从这个地方编写一个路由系统。.htacces 必须在 api/ 文件夹内。

我在这里尝试做的是一个路由系统,它根据使用的 url 在 api/index.page 中包含不同的内容。

例如,如果我去http://mywebsite.com/api/activity我想包含一个特定文件而不更改 url。

你认为有可能吗?你知道 .htaccess 的内容吗?

谢谢你的帮助。

4

1 回答 1

0

我终于自己找到了解决方案,所以我发布了解决方案,以后可能会对其他人有所帮助:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*) index.php [PT,QSA]
</IfModule>
于 2012-12-18T10:16:07.770 回答