Forum Moderators: phranque

Message Too Old, No Replies

Rewrite with variables

         

hammerite

9:29 pm on Jun 28, 2010 (gmt 0)

10+ Year Member



I'm having an issue with an Apache rewrite:

frsLaunch.htm?u=1&sl=1&launchId=F5290900747072&e=1

I've tried many different ways, but the query piece is messing things up.

Any ideas?

g1smd

11:50 pm on Jun 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That must be because the code isn't correctly assembled.

As you didn't explain what you are trying to do, nor did you post any code, there's no way to make any further comments.

hammerite

12:08 am on Jun 29, 2010 (gmt 0)

10+ Year Member



Oops, well I was looking for a friendlier url.

For instance:

http://www.example.com/frsLaunch.htm should go to :

http://www.example.com/frsLaunch.htm?u=1&sl=1&launchId=F5290900747072&e=1

[edited by: jdMorgan at 3:14 am (utc) on Jul 6, 2010]
[edit reason] example.com [/edit]

g1smd

7:33 am on Jun 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using the more than 6000 previous examples of this question here in this forum, please post some example code to discuss.

jdMorgan

3:18 am on Jul 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Example using Apache mod_rewrite in /.htaccess:

RewriteCond %{QUERY_STRING} =""
RewriteRule ^frsLaunch\.htm$ http://www.example.com/frsLaunch.htm?u=1&sl=1&launchId=F5290900747072&e=1 [R=301,L]

Jim

hammerite

1:39 pm on Jul 6, 2010 (gmt 0)

10+ Year Member



Hmm I tried a variation of that, but that looks intriguing without the condition I'll check that out, thanks.

g1smd

10:56 pm on Jul 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What variation did you try?

hammerite

11:12 pm on Jul 6, 2010 (gmt 0)

10+ Year Member



One I tried, "RewriteRule frsLaunch.htm$ http://www.example.com/frsLaunch.htm?u=1&sl=1&launchId=F5290900747072&e=1 [R=301,L]"

I also didn not use the RewriteCond which is probably why it never worked :)
I forgot the carat and to escape the . in the rule as well.

I'll check it out soon. Thanks again!

jdMorgan

3:03 am on Jul 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Without the RewriteCond checking QUERY_STRING for blank, the rule would loop on itself and eventually throw a server error.

Jim