我要创建一个新网站;内容归类为文章;标签和类别我有文件夹 1 和文件夹 2,它们是远程 Web 服务器上的文件夹;这两个文件夹中的每一个都可能包含 HTML 文件
我希望所有浏览我网站的人
1-When he types
www.domin.com/folder1/ -->dispaly the index.html file under the folder1 folder
2-When he types www.domin.com/folder1 --> error
3-When he types
www.domain.com/folder1/file1/
dispaly the /folder1/file1.html file
4-When he types
www.domain.com/folder/file.html or
www.domain.com/folder/file
dispaly an eror: such file does not exist
其实,我做的就是要点: 1, 3 以下.htacces文件内容(在远程web服务器的public_html文件夹下)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*[^.]+\.php(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ http://www.domain.com/$1/ [R=301,L]
#DirectorySlash On
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.html [NC,L]
#RewriteRule ^([^\.]+)$ $1.htm [NC,L]
#RewriteRule ^([^\.]+)$ $1.php [NC,L]
我需要帮助来修改我的 .htaccess 文件以符合第 2 点和第 4 点,非常感谢