Forum Moderators: phranque
I would like to enter an address such as [localhost...] and have it rewritten by mod_rewrite into [localhost...]
I can do this fine with this:
RewriteRule ^Products\.html$ Index.php?Application=Products [L] So in the browser address bar you will see [localhost...]
However, now I want to send some variables to this application like this: [localhost...] and I want my PHP page Index.php to have access to the variables Application and Message. So the idea is that we request an application (which is called Products) and send to it whatever parameters we want.
The problem is that I want to have the browser only show [localhost...] in the address bar (but still pass the extra parameters).
First, is this possible with my setup?
Second, here is my current attempt to get this to work:
RewriteCond %{QUERY_STRING} (.*)
RewriteRule ^Products\.html$ Index.php?Application=Products&%1 [L] So this does send the parameters to my application (I have access to them when I need them), but my browser address bar looks messy.
Thank you for any suggestions or improvements. I've researched a fair bit but cannot find a solution.
Jon
Index.php?Application=Products&some=othervariable Otherwise you'd have to think about an URL layout like /producs-Message-TestMessage or whatever, but include the vars into the path instead of the query string.