0
有人可以帮我用这个应用程序格式的htaccess规则。.htaccess多个文件夹和根目录
这里是我的文件结构:
/api
- /1.0 (this is a php project, a backend rest api of sorts to the frontend)
- /other-php-folders
- /...(lots of stuff)
- /public
- /...(lots of assets etc)
- /index.php
- /.htaccess (ignore for now)
/src (this contains an angularjs compiled website)
- /assets
- /cool-asset.js
- /cool-asset2.css
- /cool-asset3.png
- /index.html
- /.htaccess
/.htaccess
所以我基本上是从根.htaccess文件想:
- 的所有流量重定向开始 “/ API /” 到“/ API/*”。这包括所有资产。
- 所有其他流量转到“/ src/*”。
- in /src/.htaccess:我需要像往常一样查看/ src中的所有文件请求,但所有url请求都只是转到index.html(RewriteRule^index.html [L])。
也是另一个不错的功能,我会爱:
- 网址:(例如/api/1.0)mydomain.com/api/latest链接到预先定义的文件夹,或者如果有是一种从文件夹名称中查找最新版本号的方法(但是由于它可以很容易地进行硬编码并且会有很多请求,因此计算它可能会有太多的处理能力)。
任何帮助表示赞赏。 在此先感谢。