.htaccess - HMVC Api 请求给出 404
问题描述
我有一个 ci3 和 react js 项目,我的应用程序位于 var/www/html/reactframework 目录中,我已经像这样配置了我的虚拟主机和 .htaccess
> <VirtualHost *:8081>
> ServerAdmin webmaster@localhost
> ServerName local.reactframework.com
> DocumentRoot /var/www/html/reactframework
> ErrorLog ${APACHE_LOG_DIR}/error.reactframework.log
> CustomLog ${APACHE_LOG_DIR}/access.reactframework.log combined </VirtualHost>
.htaccess 在根
RewriteEngine On
Options -Indexes
Header always edit Set-Cookie (.*) "$1; HTTPOnly"
Header set X-XSS-Protection "1; mode=block"
<IfModule mod_rewrite.c>
RewriteRule (.*) http://www.example.com/$1?vardump&thex=%{REQUEST_FILENAME} [R=301,L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.html [NC,L]
</IfModule>
用户应用程序中的 .htaccess
RewriteEngine On
Options -Indexes
Header always edit Set-Cookie (.*) "$1; HTTPOnly"
Header set X-XSS-Protection "1; mode=block"
#php_value session.cookie_httponly 1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
我一直在尝试让它工作一段时间,但我无法访问我的 api。我的项目结构是这样的
reactframework
...user
....application
......modules
.......auth
.........controllers
...........Auth.js
....htacces
同样的项目已经上线并且在 aws 上正常工作,我是新手,一直在尝试为我的系统配置它。我敢肯定这是我找不到的非常小的东西。请帮忙 !!!
解决方案
推荐阅读
- python - Python3.8 `all()` 不短路
- reactjs - jsPDF 中的矩阵类在 React 中无法访问
- javascript - 想确认对使用 create-react-app 导入 index.js 的默认行为的理解
- node.js - 如何使用 discord.js 检查有多少人有角色?
- vue.js - vue-router 嵌套路由和多个路由器视图没有内容
- javascript - 以编程方式确定 S3 存储桶中是否存在文件前缀
- typo3 - TYPO3 4.5:升级到新版本 - 一次还是增量?
- integration-testing - Quarkus 原生镜像测试和注入
- type-conversion - DolphinDB 中的数据类型转换
- docker-compose - 以编程方式更新 traefik IP 白名单