Don't forget about MIME Types!
Don't forget about MIME Types!
I had a fairly rough time getting my fast downloads working on my KF server as well. I definitely recommend using the compression method to compress the map files into a .rom.uz2 format that is MUCH smaller than the normal .rom file. There are atleast 3 or 4 guides I have seen on these forums alone about how to compress the .rom files into .rom.uz2 map files so I'm not going to reiterate that process now. This will help you save tons of bandwidth from your website. Unless of course your web hosting provider doesn't care how much bandwidth you consume.
But CozmicShredder pointed out something very important in another thread regarding this redirect topic. MIME Types! Basically most web servers do not recognize .rom or .rom.uz2 file types by default. So the web server has no idea what to do with the map files once you have uploaded them to the web server. In order to make the web server recognize and handle the map files properly you will most likely need to add a MIME type to your domain on the web server. I have never worked with Linux server or Apache so I'm no help there but with Windows servers, you can easily add a MIME type to your domain using IIS.
A quick way to test if you need to setup MIME types for your map downloads to work is to simply browse to one of the map files you have uploaded to you website such as (example:
http://www.yourdomain.com/kfmaps/kf-prison.rom.uz2). If your web browser pops up a download file window and asks you to save it to your disk and allows you to download it then you should be all set and your server should be able to fast download these maps to people as needed (Provided you have setup the server's .ini config file properly of course).
If you receive a page or resource can't be found error when trying to directly browse to one of your map files on your web server. Then your website is not recognizing the map files and you will need to create a MIME Type. Below is what the MIME Types would be like in Windows IIS. I also copied and pasted CozmicShredder's notes from another thread for Apache as I know nothing about Apache as previously stated.
-----------------------------------------------------------------------
Windows MIME Types - Create 2 seperate MIME Types
MIME Type #1
Content Type: application/ut2004-uz2-rom
Extension: .uz2
MIME Type #2
Content Type: application/ut2004-uz2-rom
Extension: .rom
-----------------------------------------------------------------------
Apache MIME Type As Described by CozmicShredder In Another Thread:
For apache on a dedicated machine I use this
Like for instance I am using Xampp on my dedicated box
C:\xampp\apache\conf\mime.types
Just add a line
application/ut2004-uz2-rom uz2 .uz2 rom .rom
Then restart apache
-----------------------------------------------------------------------
After adding those MIME Types to your website you should then be able to browse directly in your web browser to one of the map files on your website (example:
http://www.yourdomain.com/kfmaps/kf-prison.rom.uz2) and the web browser should open a download prompt asking you to download the map file. That is how you know it is working properly. Then make you sure your KF Game Server's .ini file is all setup and you should be all set to go.
That MIME Type part gave me a headache last night and that is the best way I can describe how to determine if that is your problem and if so, how to fix it. If you want to see the custom map redirect working with compression and very fast downloads in all it's glory, check my server below while it's on a custom map. Hope this information helps! If enough people want, I can open up this information as a new thread to be stickied or feel free to copy and paste it to any other guides. Good Luck!