我怎麼能把索引/目錄索引?如何把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