首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >403禁止角7应用

403禁止角7应用
EN

Stack Overflow用户
提问于 2019-11-21 01:21:25
回答 1查看 360关注 0票数 0

我的网站在进入domain.com或https://example.com时返回403 Forbidden You don't have permission to access / on this server

但在https://www.example.com中工作得很好

它在domain.com/file中运行良好,但在https://example.com/file中出现错误

这是我的.htaccess

代码语言:javascript
复制
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

我的.htaccess中是否缺少任何内容?或者它是由其他原因引起的?

EN

回答 1

Stack Overflow用户

发布于 2019-11-21 01:42:18

尝试使用official documentation中指定的.htacces,它非常适合我。

代码语言:javascript
复制
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58960042

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档