Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
UrlRewrite with query string
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
whostheJBoss  
View profile  
 More options Jun 25, 12:29 pm
From: whostheJBoss <dotfus...@changethings.org>
Date: Thu, 25 Jun 2009 09:29:08 -0700 (PDT)
Local: Thurs, Jun 25 2009 12:29 pm
Subject: UrlRewrite with query string
I don't see my post showing up in the discussion, so if this goes in
twice, I'm sorry!

I have my rules set up to catch anything after a / and redirect it to
index.php with a PATH_INFO variable. The index.php

reads the PATH_INFO variable and makes the appropriate decision about
routing to events.

I have other specific rules in addition to this one, but here is the
catch-all:

<rule>
 <from>^/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

So, this works for:

http://mysite.com/someaction/somethingelse  (redirects to
http://mysite.com/index.php?PATH_INFO=someaction/somethingelse)
http://mysite.com/index.php/someaction/somethingelse (redirects to the
same as the one above)
The index.php parses PATH_INFO and pulls out my variables for use in
PHP. The problem is that I need certain variables to be

available before the parse, such as debug, etc

I can pass variables such as:

http://mysite.com/someaction/somethingelse/id/1 (id=1) or
http://mysite.com/someaction/somethingelse/id/1/myname/test (id=1,

myname=test) and they work fine.

However, http://mysite.com/someaction/somethingelse/?id=1 does not
pick up the ID variable

If I use http://mysite.com/someaction/somethingelse/&id=1 it does...

So, I basically need a way for all of my rewrites to first detect if
there is a query string, then rewrite everything before

the querystring by the rule and attach the query string onto that.

I need to be able to do this:

http://mysite.com/someaction/somethingelse/?debug=yes
http://mysite.com/someaction/somethingelse/?id=1&myname=test

and have them redirect to:

http://mysite.com/index.php?PATH_INFO=someaction/somethingelse&debug=yes

So, I need the query string added on to the end of any request if it
exists. Right now my rule simply passes everything

after the / as the PATH_INFO variable.

My rules are here:

<rule>
 <from>^/index.php/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

<rule>
 <from>^/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

<rule>
 <from>/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

Any ideas???


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
whostheJBoss  
View profile  
 More options Jun 25, 11:55 am
From: whostheJBoss <dotfus...@changethings.org>
Date: Thu, 25 Jun 2009 08:55:45 -0700 (PDT)
Local: Thurs, Jun 25 2009 11:55 am
Subject: UrlRewrite with query string
I have my rules set up to catch anything after a / and redirect it to
index.php with a PATH_INFO variable. The index.php reads the PATH_INFO
variable and makes the appropriate decision about routing to events.

I have other specific rules in addition to this one, but here is the
catch-all:

<rule>
 <from>^/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

So, this works for:

http://mysite.com/someaction/somethingelse  (redirects to
http://mysite.com/index.php?PATH_INFO=someaction/somethingelse)
http://mysite.com/index.php/someaction/somethingelse (redirects to the
same as the one above)
The index.php parses PATH_INFO and pulls out my variables for use in
PHP. The problem is that I need certain variables to be available
before the parse, such as debug, etc

I can pass variables such as:

http://mysite.com/someaction/somethingelse/id/1 (id=1) or
http://mysite.com/someaction/somethingelse/id/1/myname/test (id=1,
myname=test) and they work fine.

However, http://mysite.com/someaction/somethingelse/?id=1 does not
pick up the ID variable

If I use http://mysite.com/someaction/somethingelse/&id=1 it does...

So, I basically need a way for all of my rewrites to first detect if
there is a query string, then rewrite everything before the
querystring by the rule and attach the query string onto that.

I need to be able to do this:

http://mysite.com/someaction/somethingelse/?debug=yes
http://mysite.com/someaction/somethingelse/?id=1&myname=test

and have them redirect to:

http://mysite.com/index.php?PATH_INFO=someaction/somethingelse&debug=yes

So, I need the query string added on to the end of any request if it
exists. Right now my rule simply passes everything after the / as the
PATH_INFO variable.

My rules are here:

<rule>
 <from>^/index.php/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

<rule>
 <from>^/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

<rule>
 <from>/(.*)$</from>
 <to last="true">/index.php?PATH_INFO=$1</to>
</rule>

Any ideas???


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google