D&C GLug - Home Page

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

Re: [LUG] apache2 url rewriting

 

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/



--
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