2011-09-27 37 views
0

我编码了我的url文本(例如:Ice's Bird),并通过htaccess重定向将它作为参数传递给另一个文件,URL如下所示。php url encode和htaccess参数

http://test.com/nature-pic-Ice%26%23039%3Bs_bird.php

在上面的网址,我想这个词冰的鸟作为参数,但在此之前单引号,当然我能得到的只有两个字:冰

我重定向代码是

RewriteCond %{REQUEST_URI} ^/nature-pic-(.*).php 
RewriteRule ^nature-pic-(.*)\.php content.php?tpath=$1 [L] 

如何从网址获取完整的单词?

+0

你有很多这些名字的使用单引号完全测试? –

+0

是的,我有几个名字 – nithi

回答

0

这应该是你的.htaccess

RewriteEngine On 
RewriteRule ^nature-pic-(.*).php test.php?tpath=$1 [L] 

与该地址自然PIC-Ice's_bird.php希望这将有助于

+0

我已经使用了与你所提到的相同的重定向。但单引号之后的单词被终止。 – nithi

+0

这很奇怪,因为这是print_r($ _ GET);的页面我给他的数组([tpath] => Ice's_bird) – elibyy

+0

也注意到我删除了\ .php前的\ – elibyy