正在尝试查找静态网站的自定义.htaccess
我正在创建一个新的静态网站。我有正在尝试查找静态网站的自定义.htaccess,.htaccess,web,url-redirection,.htaccess,Web,Url Redirection,我正在创建一个新的静态网站。我有folder1和folder2,它们是远程web服务器上的文件夹。这两个文件夹中的每一个都可能包含HTML文件 我希望发生以下事情: 当他键入www.domin.com/folder1/-->时,会在folder1文件夹下显示index.html文件 当他键入www.domin.com/folder1-->错误时 当他键入www.domain.com/folder1/file1/-->时,显示/folder1/file1.html文件 当他键入www.domain
folder1
和folder2
,它们是远程web服务器上的文件夹。这两个文件夹中的每一个都可能包含HTML文件
我希望发生以下事情:
domain.com/
domain.com/about file/
domain.com/folder1/
domain.com/folder1/file/
RewriteEngine on
RewriteBase /
RewriteRule ^([^/]+)/$ $1/index.html [QSA,L] # rule 1
RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.html [QSA,L] # rule 3
RewriteRule ^[^/]+(/[^/]+(\.html)?)?$ doesnotexists.html [L] # rule 2 and 4
好的,如果/folder/index.html或/folder/不存在,它应该显示404。你是说/folder*1*/index.html吗?关于访问,您的ErrorLog${APACHE\u LOG\u DIR}/error.LOG说明了什么?是否还有其他错误?将显示doesnotexists.html文件。因此,我认为.htaccess规则中存在错误