Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite including parameters

desperate

         

Navi

11:15 am on Mar 16, 2004 (gmt 0)

10+ Year Member



i've been trying for hours but it just wont work.

my problem is i have 2 domains.

www.oldexample.com and www.newexample.com

i want when i type this in my browser:
www.oldexample.com/index.cfm?sid=50

it should go to
www.newexample.com/index.cfm?sid=50

but i just cant get it to work, ive tried like 1000 example's and stuff tried myself but nope.

this is what i have:

RewriteEngine on
Options +FollowSymlinks

Redirect ^/index.php?id=(.*)$ [newexample.com...] [R]

Longhaired Genius

11:34 am on Mar 16, 2004 (gmt 0)

10+ Year Member



Try:

RewriteEngine on
Options +FollowSymlinks

RewriteRule ^index.php?id=(.*)$ [newexample.com...] [R=301,L]

Navi

11:50 am on Mar 16, 2004 (gmt 0)

10+ Year Member



no this does't work either, i get a 404 error

netnerd

12:01 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Im trying to do this:

[mysite.com...]

to

[mysite.com...]

and it works using:

RewriteRule ^([^/]+)/$category.php?cat=$1 [L]

Now - how do i do the same thing for 2 levels?

e.g.
[mysite.com...]

to

[mysite.com...]

Really need to get this done so id be very greatful for any help

Thanks!

Alternative Future

12:42 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This might help [webmasterworld.com]

-George

netnerd

4:23 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Think you can help me with my quesry George?

Alternative Future

5:14 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi netnerd,

Am not by any means good at mod_rewrite but is it not as simple as

RewriteRule ^([^/]+)/([^/]+)/$ category.php?cat=$1;cat2=$2 [L]

I am sure someone else will correct me if I am wrong :)

-George

[edited by: jdMorgan at 12:27 am (utc) on Mar. 18, 2004]
[edit reason] fixed missing space only [/edit]

iano99

11:18 pm on Mar 16, 2004 (gmt 0)

10+ Year Member



Navi,

have you managed to pass the?paramters through yet. I'm having the same problem and getting 404 errors.

netnerd

11:09 am on Mar 17, 2004 (gmt 0)

10+ Year Member



Alternative - that works! Thanks!

Alternative Future

11:29 am on Mar 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wow that's a first netnerd... :)

Thanks for letting me know.

-George