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
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
 
When You Register, These Ads Go Away!
Old 11-01-2007, 12:48 AM Re: Apache ModRewrite - Url has slashes and question mark
Junior Talker

Posts: 2
Name: Eric K
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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.10958 seconds with 12 queries