Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Apache ModRewrite - Url has slashes and question mark
Old 11-01-2007, 12:35 AM Apache ModRewrite - Url has slashes and question mark
Junior Talker

Posts: 2
Name: Eric K
Trades: 0
hello,

I'm trying to use RewriteRule to turn this:
ht1p://site.com/api/1.0/transload.xml?additional_params

where additional_params is optional stuff like:
url=http://google.com/logo.gif&overwrite=true&async=true

so the full url would be:
ht1p://site.com/api/1.0/transload.xml?url=http://google.com/logo.gif&overwrite=true&async=true

rewritten as:
ht1p://site.com/api.php?version=1.0&method=transload&responseType= xml&url=http://google.com/logo.gif&overwrite=true&async=true

my .htaccess:
RewriteEngine On
RewriteRule ^api/(.*)/(transload|upload)\.(xml|json)\?(.*)$ api.php?v=$1&method=$2&responseType=$3&$4 [L]

i'm having a problem with the question mark after the (xml|json) as none of the parameters are passed through the rewrite..

any help would be greatly appreciated

Last edited by DoQrs; 11-01-2007 at 12:39 AM..
DoQrs is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-01-2007, 12:48 AM Re: Apache ModRewrite - Url has slashes and question mark
Junior Talker

Posts: 2
Name: Eric K
Trades: 0
edit: solved my own problem.
solution -> using: RewriteCond %{QUERY_STRING}

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^api/(.*)/(transload|upload)\.(xml|json)$ api.php?v=$1&method=$2&format=$3&%1 [L]
DoQrs is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Apache ModRewrite - Url has slashes and question mark
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09812 seconds with 12 queries