D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] apache2 url rewriting

 

On 16/02/10 13:50:09, Simon Waters wrote:
stinga@xxxxxxxxxxxxx wrote:
I know to do this if there is nothing else on the url. Just add it,  
no worries. Bit what do I do if there is something else on the url.  
I.E
mod_rewrite has a feature for this "QSA"ยท

I think I could take everything after the ? then string the bits together.
Let Apache take the strain.

Append new query to original query
RewriteRule ^page\.php$ /target.php?bar=baz [QSA,L]
# from http://example.com/page.php?foo=bar
# to   http://example.com/target.php?foo=bar&bar=baz

From
http://www.simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/
Ta, that did what I wanted!

--
'ooroo

stinga...(:)-)
---------------------------------------------------
Email: stinga@xxxxxxxxxxxxx      o
You need only two tools.        o /////
A hammer and duct tape. If it    /@   `\  /) ~
doesn't move and it should,     >  (O)  X<  ~  Fish!!
use the hammer. If it moves and  `\___/'  \) ~
shouldn't, use the tape.           \\\
---------------------------------------------------

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html