我的网站在进入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
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]我的.htaccess中是否缺少任何内容?或者它是由其他原因引起的?
发布于 2019-11-21 01:42:18
尝试使用official documentation中指定的.htacces,它非常适合我。
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.htmlhttps://stackoverflow.com/questions/58960042
复制相似问题