使用htaccess在URL中用_(下划线)替换#(hash)

时间:2016-08-12 08:27:29

标签: .htaccess

我有以下网址,所有#符号都需要替换为_

http://localhost/test/my#module/my#index.php?param2=10&param2=10

我试过下面.htaccess代码,但没有工作。我搜索了很多解决方案,但没有一个能正常工作。

Options +FollowSymlinks -MultiViews
RewriteEngine on
# keep replacing space to hyphen until there is no space use internal rewrite
RewriteRule ^([#]*)[#]+(.*)$ $1-$2 [E=NOSPACE:1]
# when there is no space make an external redirection
RewriteCond %{ENV:NOSPACE} =1
RewriteRule ^([#]+)$ $1 [R=301,L]

请告诉我如何解决这个问题。

0 个答案:

没有答案
相关问题