我正在使用 nanoCMS(来自 mini-print.com)作为网站。以及他们提供的 htaccess 文件。
目录结构是 -
cms/
error404.php
htaccess-laplume.txt
htaccess.txt
img/
readme.txt
进入时localhost/
,我得到文件列表而不是重定向到/cms/index.php
我无法弄清楚这一点!任何人都可以提出一些帮助吗?
(这里是 htaccess 文件)
# Edit and save this file as .htaccess before uploading
AddDefaultCharset UTF-8
Options +FollowSymLinks -Indexes
RewriteEngine On
DirectoryIndex index.php
ErrorDocument 404 /error404.php
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^$ /cms/index.php [L]
RewriteCond %{REQUEST_URI} ^/cms/inc/menu\.php$ [OR]
RewriteCond %{REQUEST_URI} ^/cms/inc/inmenu\.txt$ [OR]
RewriteCond %{REQUEST_URI} ^/cms/admin/list\.php$ [OR]
RewriteCond %{REQUEST_URI} ^/cms/([A-Za-z0-9_-]+)\.txt$ [OR]
RewriteCond %{REQUEST_URI} ^/cms/comments/([A-Za-z0-9_-]+)\.txt$ [OR]
RewriteCond %{REQUEST_URI} ^/img/$
RewriteRule .* - [F]
RewriteCond %{REQUEST_URI} ^/cms/$
RewriteRule ^cms/$ / [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /cms/([A-Za-z0-9_-]+)\.php\ HTTP/
RewriteRule ^cms/([A-Za-z0-9_-]+)\.php$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^/index$
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([A-Za-z0-9_-]+)\ HTTP/
RewriteRule ^([A-Za-z0-9_-]+)$ /cms/$1.php [L]