Htaccess 不允许在子文件夹应用程序中请求资源
Htaccess doesn't allow requesting resources in sub folder application
我在配置 .htaccess 文件时遇到问题。应用程序是用 AngularJs 编写的,而 restApi 应用程序是用 Codeigniter 编写的,它位于 /server 文件夹中。
这是我的文件夹结构
我的 api 文件夹结构
这是我正在处理的 .htaccess 文件
RewriteEngine on
RewriteCond !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ /index.php/ [L]
问题是,每当我尝试访问我的 api 资源时,我总是收到 404 页面,而这在我的 debian nginx 服务器上运行得很好,这就是为什么我猜测这是.htaccess 文件中的问题
http://myApp.com/server/api/products/latest/1
希望大家能帮帮我。如果您需要任何其他信息,请告诉我,我会提供。提前谢谢你。
在 .htaccess 中尝试
RewriteBase /server/
还要确保在 config.php
$config['index_page'] = ' ';
我在配置 .htaccess 文件时遇到问题。应用程序是用 AngularJs 编写的,而 restApi 应用程序是用 Codeigniter 编写的,它位于 /server 文件夹中。
这是我的文件夹结构
这是我正在处理的 .htaccess 文件
RewriteEngine on
RewriteCond !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ /index.php/ [L]
问题是,每当我尝试访问我的 api 资源时,我总是收到 404 页面,而这在我的 debian nginx 服务器上运行得很好,这就是为什么我猜测这是.htaccess 文件中的问题
http://myApp.com/server/api/products/latest/1
希望大家能帮帮我。如果您需要任何其他信息,请告诉我,我会提供。提前谢谢你。
在 .htaccess 中尝试
RewriteBase /server/
还要确保在 config.php
$config['index_page'] = ' ';