【问题标题】:redirect add '#' after base of url重定向在 url 的基础后添加“#”
【发布时间】:2018-08-18 14:01:19
【问题描述】:

我想通过在基础之后添加# 来重定向所有网址,即使它有参数。

示例:(基数为http://localhost/test/

# input
http://localhost/test/index.html
# output
http://localhost/test/#/index.html/

# input
http://localhost/test/dynamic/1
# output
http://localhost/test/#/dynamic/1

这是我的.htaccess 文件:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
Options -Indexes
RewriteRule ^(.+)$ index.html?/ [QSA,L]

【问题讨论】:

  • 我看到很多关于我的问题的问题。他们中的大多数都放置了相同的标签

标签: php apache .htaccess redirect


【解决方案1】:

在您当前的规则之前尝试以下规则,

RewriteEngine On
RewriteRule ^(.*)$ http://%{HTTP_HOST}/#/$1 [R=301,NE]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-08
    • 1970-01-01
    • 2019-05-31
    • 2015-04-15
    • 1970-01-01
    • 2017-07-08
    • 2010-12-15
    • 1970-01-01
    相关资源
    最近更新 更多