?
Solved

More mod_rewrite help.

Posted on 2005-03-07
3
Medium Priority
?
214 Views
Last Modified: 2010-03-04
I asked a questions here:
 http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_21317308.html

I got an answer, here is what I am using:
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^index\.php - [L]
RewriteRule ^([^/]+)/([^/.]+)/?$ /new/index.php?d=$1&p=$2 [L]

Now, I need to be able to have the URL like this: http://company.com/new/variable/variable/?foo=a

when I try that the foo=a is never recognized. Is there a simple way to make the URL query come into the rewrite rule.
0
Comment
Question by:ssammons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 1000 total points
ID: 13480430
add the QSA-Flag:

RewriteEngine on
Options +FollowSymlinks
RewriteRule index\.php - [L]
RewriteRule ^([^/]+)/([^/.]+)/?$ /new/index.php?d=$1&p=$2 [L,QSA]
0
 
LVL 27

Expert Comment

by:caterham_www
ID: 13480498
the result of the flag is that the querystring from the request (foo=a) is not replaced by the substitution but added to the substitution.

So you'll get /new/index.php?d=variable1&p=variable2&foo=a in this example
0
 
LVL 4

Author Comment

by:ssammons
ID: 13480520
Yep thanks exactly what I needed. I read right over that in the docs...just spelled out too kryptically for my brain power :P I live for examples thanks!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question