
我 當我打電話時http://www.mysite.in/abc/xyz它應該會出現http://www.mysite.in/abc/xyz/index.php但地址欄中的 url 不會改變,並且地址中沒有“/”時它應該可以工作。請任何人幫我解決 apache 2.2 的 .htaccess 程式碼
注意:它不應該列出它應該顯示在頁面上的目錄內容。
謝謝斯里坎特
答案1
我就是這樣做的 將以下程式碼加入根資料夾 .htaccess
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(abx/xyz.html)/?$ $1/index.php [L,NC]
並將以下程式碼加入 xyz.html 資料夾中的 .htaccess 檔案中
DirectorySlash Off
Directoryindex index.php
Options -Indexes
答案2
您需要配置DirectoryIndex index.php
和Options -Indexes
。
兩者都應該是任何 Apache / PHP 安裝的預設配置。
您的配置似乎有問題。