1

にリダイレクトする書き換えルールがありwww.OLDsite.co.uk/locations.php?area=Barking,%20Essexますwww.NEWsite.co.uk/locations.php?area=Barking,%20Essex

...ideally, anyways. The problem exists at the end of the url. Instead of redirecting to the new site above like it should...it makes the following url instead: www.NEWsite.co.uk/locations.php?area=Barking,%2520Essex. I am really confused...here's my .htaccess file as it stands currently...

RewriteEngine on
RewriteRule ^locations.php/(.*)$ http://www.NEWsite.co.uk/locations.php$1 [R=permanent,L]
ErrorDocument 404 /404.php

I'm new to mod_rewrites, but I'm willing to learn. I know it's a very powerful tool and it wouldn't be a bad thing to have in my developer arsenal. All tips are appreciated.

4

2 に答える 2

2

RewriteRule を次のように変更します。

RewriteRule ^(locations\.php.*)$ http://www.localhost/$1 [R=301,L,NE]

ここでの重要な変更は、生成されたNEURI をエンコードしないように Apache に指示するフラグです。%20%20%2520

于 2012-04-17T05:32:39.333 に答える
1

問題は次のとおりです。

%25 is equal to "%" symbol

しかし、それは %20 またはスペースに等しい..スペースを使用しないでください..「+」を使用してください

于 2012-04-17T05:33:31.820 に答える