Passing a message through url

Using mod_rewrite to handle various content issues

Passing a message through url

Postby grant464 » Sat Feb 03, 2007 10:55 pm

Thanks for your help guys, I've been experimenting for a few hours now without much luck!

The way I have structured my website, I SOMETIMES pass an extra variable through the url.

Ex: --> index.php?city=city&page=page OR --> index.php?city=city&page=page&msg=4

The "/msg/4/" only appears when, say, a user logs in. The page will display message 4 saying "Logged In!".

Is there a way to make a rule for the "/msg/4/" part without making another rewrite rule. If I have 10 rewrite rules, I don't want to create another 10 rules to handle ALL of the messages. Preferably, 1 rule to make it 11 total!


Unless, anyone knows of a better way to pass variables from one page to another without having them in the url? (using php).


Thanks for the help,

Posts: 2
Joined: Sat Feb 03, 2007 10:44 pm

Postby richardk » Sun Feb 04, 2007 10:15 am

Post your RewriteRules.
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby grant464 » Sun Feb 04, 2007 10:26 am

As I see your reply, I found a solution that works for me. Writing [QSA] at the end of the rewrite rule allows me to write:

This is good enough for me.

Thanks anyways,

Posts: 2
Joined: Sat Feb 03, 2007 10:44 pm

Return to Content

Who is online

Users browsing this forum: No registered users and 1 guest