Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
get params to the url rewrite
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
  4 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
 
Roublard  
View profile  
 More options Nov 5, 3:28 am
From: Roublard <alexey.petu...@gmail.com>
Date: Thu, 5 Nov 2009 00:28:04 -0800 (PST)
Local: Thurs, Nov 5 2009 3:28 am
Subject: [?] get params to the url rewrite
Guys, hi!

Have a problem here, kinda novice in url rewriting. Need a rewriting
rule from
/oc/TaskStart.do?method=selectTaskMethod&mid=91023909520346476
to
/methods/oc/91023909520346476

I've tried a lot of reqexps but still have no luck to create it. Could
you please provide me an example?

Looks like it could be simething like

    <rule>
        <name>redirect method selector</name>
        <from>^/oc/TaskStart.do?method=selectTaskMethod&mid=(.+)$</
from>
        <to type="permanent-redirect" last="true">/methods/oc/$1</to>
    </rule>

But it doesn't work of course :(

Thanks in advance!!!


    Reply    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.
Avlesh Singh  
View profile  
 More options Nov 5, 9:17 pm
From: Avlesh Singh <avl...@gmail.com>
Date: Fri, 6 Nov 2009 07:47:36 +0530
Local: Thurs, Nov 5 2009 9:17 pm
Subject: Re: [?] get params to the url rewrite

> Have a problem here, kinda novice in url rewriting. Need a rewriting rule
> from /oc/TaskStart.do?method=selectTaskMethod&mid=91023909520346476 to
> /methods/oc/91023909520346476

Are you sure that you want it written that way? Use cases are generally the
reverse!

Anways,

if your answer is yes -
<from>/oc/TaskStart.do\?method=selectTaskMethod&amp;mid=(.*)</from>
<to type="permanent-redirect" last="true">/methods/oc/$1</to>
Don't forget to turn on the "use-query-string" parameter in the root node.

if reverse if what you wanted to do -
<from>/methods/oc/(.*)</from>
<to type="permanent-redirect"
last="true">/oc/TaskStart.do\?method=selectTaskMethod&amp;mid=$1</to>

Cheers
Avlesh


    Reply    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.
baby  
View profile  
 More options Nov 9, 5:32 am
From: baby <babybaby...@gmail.com>
Date: Mon, 9 Nov 2009 02:32:32 -0800 (PST)
Local: Mon, Nov 9 2009 5:32 am
Subject: Re: get params to the url rewrite
Hi,

I am new to URL re-writing. I have the same question. How can i pass
the query parameters to the actual URL

e.g. Here is my rule

<rule>
    <from>^/([A-Za-z0-9]+)$</from>
    <to>/test.do?id=$1</to>
</rule>

now when user provide the URL like : http://localhost:8080/test/prodcut001?code=001&name=test
then how can i pass "code=001&name=test" in the actual URL i.e. /
test.do?id=product001&code=001&name=test

Thanks,
Baby

On Nov 6, 7:17 am, Avlesh Singh <avl...@gmail.com> wrote:


    Reply    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.
Avlesh Singh  
View profile  
 More options Nov 9, 12:09 pm
From: Avlesh Singh <avl...@gmail.com>
Date: Mon, 9 Nov 2009 22:39:21 +0530
Local: Mon, Nov 9 2009 12:09 pm
Subject: Re: get params to the url rewrite

> e.g. Here is my rule

> <rule>
>    <from>^/([A-Za-z0-9]+)$</from>
>    <to>/test.do?id=$1</to>
> </rule>

> now when user provide the URL like :
> http://localhost:8080/test/prodcut001?code=001&name=test
> then how can i pass "code=001&name=test" in the actual URL i.e. /
> test.do?id=product001&code=
> 001&name=test

Changing your rule to the underneath should work as expected -
<rule>
    <from>^/test/(.*)\?(.*)$</from>
    <to>/test.do?id=$1&amp;$2</to>
</rule>

To make this work, don't forget to add "use-query-string=true" in the root
node of your urlrewrite.xml file.

Cheers
Avlesh


    Reply    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