Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-04-2009, 07:08 AM   #1
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
unusual apache mod_rewrite rule


well i can humbly claim that i have experience with url rewriting

however , i'm having troubles with the following situation:

OK ,so here it's

which i'd like to rewrite to this format

well it probably looks complicated what i'm trying to do

but essentially all what i need is to rewrite "code" to "?id=code" and then append the rest of the query string AS IT IS to the newly rewritten url

please , keep in mind that I've used 'par1' to 'parZ' to emphazise that the following parameters can be totally arbitrary in both form and number

thanx in advance
Old 10-04-2009, 09:48 AM   #2
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Original Poster
Rep: Reputation: 40
UPDATE: OK , i've found the solution !

what is needed is using the QSA flag to the rewrite rule and it will automagically append all present GET pars to the new URL

the funny thing is that i've tried this flag out before without success , just to discover that some other rule was blocking it from happening by forcing the server to rewrite the URL endlessly

btw , the apache directive RewriteLog turned out to a great help.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 mod_rewrite rule for changing file extentions CyberDog3K Linux - Server 0 08-27-2007 01:25 AM
mod_rewrite - rule to change http to https Firebar Linux - Server 10 06-05-2007 07:29 AM
mod_rewrite rule question jmoschetti45 Linux - Software 0 03-19-2007 07:29 PM
How to enable Apache mod_rewrite, after apache installed without this modue jCash Linux - Newbie 1 10-24-2006 10:23 AM
Apache:mod_rewrite MadMikie Linux - Software 0 08-03-2004 07:33 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration