1
votes

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.

2

2 Answers

2
votes

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.

0
votes

Try $1 instead of %1