Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule question

How to replace ampersands

         

twist

8:07 pm on Feb 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've read a lot of threads but I can't seem to get it right.

Okay, this works fine,

RewriteEngine on
RewriteRule ^webpage$ /my_webpage.php
RewriteRule ^webpage-name$ /my_webpage.php?var=name

First question. Do I need to make it like this ^webpage\.php$ or can I just leave out the php?

Second question. How do I change a address like this with changing variables?

http://my_webpage.php?var1=name&var2=number&var3=type

and if I am able to change it, how do I reference it?

twist

12:18 am on Feb 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, I got this so far,

RewriteRule ^webpage/cat/([0-9]+)/?$ /my_webpage.php?var1=name&cat=$1 [L]

The first time I click the link it looks like this,

webpage/cat/1

The second time it looks like this,

webpage/cat/webpage/cat/1

I'm pretty sure I glanced at a thread that talked about this. I tried adding a [PT] but it just gave me a internal server error. Any ideas?

*edit* Okay, absolute URL's seem to clear the problem up.

jdMorgan

12:02 am on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



twist,

Welcome to WebmasterWorld [webmasterworld.com]!

I'd like to help, but I can't answer your question because you have not stated what you wish to accomplish with your rewrite.

Jim

twist

1:13 am on Feb 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I got it figured out. I needed to use absolute URL's. Thanks though.