Welcome! Log In Create A New Profile

Advanced

Help with a rewrite rule

September 13, 2010 09:49PM
I need some help with creating a rewrite rule for a virtual host on my nginx server. I'm not very familiar with rewrite rules, so I'm hoping someone can help...if its even possible.

Basically, I have a script that works like a file explorer that offers downloads and I want to do a rewrite rule to pull a PHP page that serves an ad and will start the download within 10-15 seconds.

After thinking about it, I'm not sure if a rewrite rule is actually what I need or if its some sort of redirect script, so maybe someone can shed some light on it.

Here's an example:

When you click on the link in the file explorer script, it'll let you download a file at www.website.com/device1/file1.zip (the direct path to where the file is on the server).

Instead of serving that file directly for download, we want it to pull up a download.php script that shows an ad and starts the download after xx amount of time. So the download script might look like www.website.com/download.php?device=device1&file=file1.zip

Any ideas?
Subject Author Posted

Help with a rewrite rule

mindfrost82 September 13, 2010 09:49PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready