centos7 apache httpd 解決目錄文件名中文亂碼且文件名截斷

  1. 修改頁面默認語言編碼
    打開編輯 /etc/httpd/conf/httpd.conf

        <Directory "/var/www/html">   #<-----找到網站根目錄位置
    
                ....
    
                IndexOptions Charset=UTF-8   #<-----添加此項
    
        </Directory>
    
  2. 修改目錄文件名不要被截斷

    打開編輯 /etc/httpd/conf.d/autoindex.conf,找到

    IndexOptions FancyIndexing HTMLTable VersionSort
    

    這段,並修改:

    IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=*
    
  3. 重啓 httpd 服務

     service httpd restart
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章