重定向在URL的基数后添加“#”

时间:2018-08-18 14:01:19

标签: php apache .htaccess redirect

我想通过在基数后面添加#来重定向所有URL,即使它具有参数。

示例:(基数为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]

1 个答案:

答案 0 :(得分:0)

在当前规则之前尝试以下规则

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