我怎么能把索引/目录索引?如何把index /放在DirectoryIndex中? .htaccess
当我访问这个URL localhost/mywebsite /我的网站没有妥善安排 但是当我把localhost/mywebsite/index /它工作正常。
这里是我的htaccess文件
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
DirectoryIndex index.php index.php3 index.html index.htm index/ <-- i add this
在此先感谢:)
PS。 localhost/mywebsite/index/= localhost/mywebsite/index.php 我只是隐藏我的网页的文件扩展名为/(斜线)。
您的问题一个错字;在你的问题中使用非工作URL都是'localhost/mywebsite /'。 –
你也可以详细说明你的实际问题,比“不恰当安排”更详细。 – mario
对不起。 localhost/mywebsite/index /我的意思是这个:D – Lestr1992