为连字符宽度一个变量重写%20

时间:2017-11-09 19:09:26

标签: .htaccess url-rewriting space

我现在用代码捣乱了几个小时..

我想在连字符( - )中更改空格或%20。我尝试了很多但没有任何作用。

这是我目前的代码:

RewriteEngine On
RewriteBase /sitecms/

RewriteRule ^([a-zA-Z]+)$ page.php?page=$1

sitecms是我的根,当$ 1 =测试时,我可以去localhost / sitecms / test。 但是当$ 1 =测试测试时,我得到localhost / sitecms / test%20test,我需要localhost / sitecms / test-test。

有人可以帮我解决问题吗?我只需要重写,而不是重定向

0 个答案:

没有答案