【问题标题】:Change my url from domani/index.html to domani/index [duplicate]将我的网址从 domani/index.html 更改为 domani/index [重复]
【发布时间】:2020-01-24 08:12:01
【问题描述】:

我正在尝试将我的 url 从 domani.com/index.html 更改为 domain.com/index ,我尝试了很多选项,但没有一个有效。我正在使用 aruba 作为服务器,我不知道它是否重要和 Windows 托管

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [QSA,L]

【问题讨论】:

    标签: php html .htaccess


    【解决方案1】:

    试试这个,应该可以的

    RewriteEngine on 
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)$ $1.html [NC,L]
    

    【讨论】:

    • 我试过了,但总是出现相同的错误 1°“HTTP 错误 404.17 - 未找到”,当我刷新此“HTTP 错误 404.3 - 未找到”时
    猜你喜欢
    • 2011-12-12
    • 2018-02-06
    • 2021-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2011-02-09
    相关资源
    最近更新 更多