Forum Moderators: phranque

Message Too Old, No Replies

Simple redirect

         

tomse

9:33 pm on Feb 12, 2006 (gmt 0)

10+ Year Member



Hello everybody.

I am trying to do a simple redirect for urls which aren't used any longer.

The old url is

http://example.com/directory/script.php?p=1

This should redirect to

http://example.com/directory/new/dir/

I tried with

RewriteRule ^directory/script\.php directory/new/dir/ [R=301,L]

but this results to

http://example.com/directory/new/dir/?p=1

Can anybody help me remove the parameter?

Thank you for your efforts in advance.

Kind regards

Indalo

jdMorgan

1:31 am on Feb 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add a question mark after the substitution to clear the query string:

RewriteRule ^directory/script\.php$ directory/new/dir/? [R=301,L]

Jim

tomse

9:30 am on Feb 13, 2006 (gmt 0)

10+ Year Member



Thank you very much.

It works :)