LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

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

Rep: Reputation: 40
unusual apache mod_rewrite rule


Hello,

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, 10:48 AM   #2
entz
Member
 
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.

cheers
 
  


Reply


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 02:25 AM
mod_rewrite - rule to change http to https Firebar Linux - Server 10 06-05-2007 08:29 AM
mod_rewrite rule question jmoschetti45 Linux - Software 0 03-19-2007 08:29 PM
How to enable Apache mod_rewrite, after apache installed without this modue jCash Linux - Newbie 1 10-24-2006 11:23 AM
Apache:mod_rewrite MadMikie Linux - Software 0 08-03-2004 08:33 AM


All times are GMT -5. The time now is 03:09 AM.

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