我使用的Apache 2.4.7DirectorySlash關閉不工作
這是我的虛擬主機的配置:
DocumentRoot /var/www/login
ServerName login.mydomain.com
<Directory "/var/www/login">
allow from all
AllowOverride All
Options +Indexes
DirectoryIndex index.html index.php
DirectorySlash Off
Require all granted
</Directory>
在我/var/www/login
目錄中,我有一個目錄名爲freeseat
,並在那裏,有在index.php
文件,因此它的全部位置/var/www/login/freeseat/index.php
當我嘗試通過以下鏈接(域替代)來訪問它,它重定向到以斜槓同一網址: http://login.mydomain.com/freeseat - >http://login.mydomain.com/freeseat/
爲什麼DirectorySlash Off
不工作?我試圖把它放在.htaccess
,但這也沒有幫助。
非常感謝您的幫助,
大衛
它工作的很好,但沒有斜槓可能會在目錄列表中出現錯誤的鏈接。測試時禁用瀏覽器緩存。 – Deadooshka