You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Vik Rubenfeld <vi...@mindspring.com> on 2008/04/29 18:52:00 UTC

[users@httpd] Search & Replace + Redirect with Mod_Rewrite?

I need to change the variable names in query strings. This is because  
I  need to get two different supplier companies talking to each other.  
(One supplier uses variable names that the other supplier doesn't  
recognize).

So I'm getting supplier A to send the URL to one of my domains, where  
I can change the variable names in the query string, and then redirect  
to the web site of supplier B.

For example, I'd like to change:

 > http://www.my_domain_name.com/wsb.dll/s/12345?DDR2=test_2_data&DDR3=
 > test_3_data

...to:

 > https://supplier_B.com/wsb.dll/s/12345?wsb5=test_2_data&wsb6=  
test_3_data

Here's my current mod rewrite code, which gives me a "Internal Server  
Error" message:

 > Options +FollowSymLinks
 > Options +Indexes
 > RewriteEngine On
 >
 > RewriteRule ^(.*)DDR2(.*)$ $1wsb5$2 [NC]
 >
 > RewriteRule ^(.*)DDR3(.*)$ $1wsb6$2 [NC,L]
 >
 > Redirect (.*)my_domain_name.com/wsb.dll/(.*) $supplier_B.com/ 
wsb.dll/$2

What is the correct way to do this?

Thanks very much in advance to all for any info.

Re: [users@httpd] Search & Replace + Redirect with Mod_Rewrite?

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, Apr 29, 2008 at 12:52 PM, Vik Rubenfeld <vi...@mindspring.com> wrote:
>
> I need to change the variable names in query strings. This is because I
> need to get two different supplier companies talking to each other. (One
> supplier uses variable names that the other supplier doesn't recognize).
>
> So I'm getting supplier A to send the URL to one of my domains, where I can
> change the variable names in the query string, and then redirect to the web
> site of supplier B.
>
> For example, I'd like to change:
>
> > http://www.my_domain_name.com/wsb.dll/s/12345?DDR2=test_2_data&DDR3=
> > test_3_data
>
> ...to:
>
> > https://supplier_B.com/wsb.dll/s/12345?wsb5=test_2_data&wsb6= test_3_data
>
> Here's my current mod rewrite code, which gives me a "Internal Server Error"
> message:
>
>
> > Options +FollowSymLinks
> > Options +Indexes
> > RewriteEngine On
> >
> > RewriteRule ^(.*)DDR2(.*)$ $1wsb5$2 [NC]
> >
> > RewriteRule ^(.*)DDR3(.*)$ $1wsb6$2 [NC,L]
> >
> > Redirect (.*)my_domain_name.com/wsb.dll/(.*) $supplier_B.com/wsb.dll/$2
>
> What is the correct way to do this?
>
> Thanks very much in advance to all for any info.

You'll want to start here:
http://wiki.apache.org/httpd/RewriteQueryString

Then you'll want to be sure to use the RewriteLog to debug.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org