【问题标题】:Rewrite rule to add index.shtml重写规则以添加 index.shtml
【发布时间】:2012-03-14 13:17:37
【问题描述】:

我正在尝试编写一个重写规则,这样如果在 URL 中输入地址“www.example1.test.com”,它会将 index.shtml 附加到末尾并转到该地址 - “www.examples1. test.com/index.shtml"

我已经尝试了以下两种方法,但都没有成功:

RewriteCond %{REQUEST_URI} ^www.example1.test.com$ [NC]
RewriteRule (.*)/$$1/index.shtml [R,L]

RewriteCond %{HTTP_HOST} ^www.example1.test.com$ [NC]
RewriteRule (.*)/$$1/index.shtml [R,L]

谁能告诉我我做错了什么?

谢谢

【问题讨论】:

    标签: apache redirect rewrite


    【解决方案1】:

    为了让默认页面正常工作,您有点矫枉过正。

    找到这一行。

    DirectoryIndex index.html
    

    改成如下:

    DirectoryIndex index.shtml index.html 
    

    【讨论】:

    • 感谢您的帮助
    猜你喜欢
    • 2015-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-10
    • 2016-02-28
    • 1970-01-01
    相关资源
    最近更新 更多