views:

23

answers:

1

My site uses nginx. I use apache only for large file uploading to the server. I have a script upload.php which I POST the files to via a flash uploader script.

Apache runs on a subdomain, so I post files to upload.domain.com/upload.php

Is there any way to prevent apache from serving the actual site on that subdomain? ideally I want to post files to upload.subdomain.com and have it be directed to upload.php on that subdomain

I mean I could setup a different document root for apache and thats it, but are there any other ways?

A: 

If I understand correctly you want all requests to upload.domain.com to be directed to upload.php? A RewriteRule inside the VirtualHost that catches all requests should work:

RewriteEngine On
RewriteRule .  /full/path/to/upload.php
llama
I believe it's `RewriteRule ^.*$` not `RewriteRule ^/.*$`
Matt
Depends on if your in an .htaccess or not. In the main config your path will always begin with a "/". In an .htaccess this may be removed by a RewriteBase. Normally I pull the rest over to the path info for php: ^/(.*)$ /path/upload.php/$1. In this case the match can be simplified to just ".".
llama