在.htacess中重写url相关有关问题

WBOY
Release: 2016-06-13 11:57:07
Original
827 people have browsed it

在.htacess中重写url相关问题
重写url的时候遇到一个问题,如果原url中有空格的话,那个空格要如何表示啊

例:

<br />RewriteRule ^Activites/([A-Za-z]*)$ pages%20referencement/le-bon-courtier-nos-activites-$1.php<br />
Copy after login


空格那里我是拿%20替换的,但是不幸的是,根本不管用

我把空格去了,然后就可以用了

求大神指教啊啊啊啊

------解决方案--------------------
apache 获取到的url是已经解码的,你这样写当然不对,空格直接写,但为了保证完整的字符串及$的转义,需要加双引包含。这样写就可以了。
<br />RewriteRule ^Activites/([A-Za-z]*)$ "pages referencement/le-bon-courtier-nos-activites-$1.php"<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template