views:

57

answers:

2

RewriteCond %{HTTP_HOST} ^[a-z]+.orbno.com$
RewriteCond %{HTTP_HOST} !^(www.)?orbno.com$
RewriteCond %{REQUEST_URI} download/
RewriteRule (.*) /download.php\?action=$1&user=%1 [L]

Two small issues, this is the output:

array(2) { ["action"]=> string(23) "download/email-logo.png" ["user"]=> string(0) "" }

  1. I want the user to be the subdomain they are accessing, i have wild-card DNS, how do i pass that, since %1 isnt working.

  2. Is there a way to only pass email-logo.png instead of download/email-logo.png.

A: 

Try $1 instead of %1

Scott
That cant work becuase $1 is already giving me an output, take a look at the example output.
Anthony
+2  A: 

Lump in #apache on freenode helped me out.

RewriteCond %{HTTP_HOST} ^([a-z]+).orbno.com$ RewriteCond %{HTTP_HOST} !^(www.)?orbno.com$ RewriteRule download/(.+) download.php?action=$1&user=%1

Thanks though.

Anthony