HOWTO: downloading files and HTTP redirect

robert

Senior Member
Joined
Jan 7, 2006
Likes
0
#1
[HOWTO]: downloading files and HTTP redirect

Since the release of the 1.2 patch many people have asked similar questions about the http redirect that has been added in the 1.2 patch. Of course, all these questions have been practically the same and so are the solutions so I’ve decided to document them.

What is the http redirect function?
When you are running a mod or a custom map on your server, your visitors should have the modfiles or the custom map on their computer in order to join your game. If they haven’t, they won’t be able to play on your server. The http redirect function is one of the two ways to get the files to the client.

Why would I use the http redirect function?
In the 1.0 version of Call of Duty 2 the only supported way to get modfiles or custom maps to players was through the server itself. The big disadvantage of this is speed: the downloads through the ‘basic’ download function are slow. Depending on the file size of the files to be downloaded it can take several minutes before the client is ready to join the game. Also, sending files to the client through the gameserver itself takes resources on the machine which can be used for better purposes (keeping your game lag-free, for example).

First of all, you need to know if you are able to use the http redirect. It will probably sound very logical to many of us but in order to use http redirect you need web space. If you do not have any web space, you should either rent some, or forget the idea of the http redirect function as you will not be able to use it.

How do I use the http redirect?
In order to use the http redirect, you basically need to do two things:

1. Uploading the files to your web space.
2. Editing the config file of the gameserver for http redirect usage.

1. Uploading the files to your web space
First, upload the files to your web space. Create a folder in the root of your web space called ‘main’. It’s very important that you create this folder; the http redirect will fail if the folder is not there! After you have created the folder, upload your files to it.

For example:
The website of your clan is: http://www.myclan.com
You upload your files to http://www.myclan.com/main

Naturally, you can also create some more subdirectory’s if you have an unsatisfied need for that. Just make sure that a directory called ‘main’ is in there.

A correct setup is: http://www.myclan.com/cod2/files/main
Not correct is: http://www.myclan.com/files (no ‘main’ directory)
Also not correct: http://www.myclan.com/Call of Duty 2/main (whitespace in directory name)

IIS users should add a mime-type (extension) to make IIS understand it should send the files as a download. Adding the ‘iwd’ extension should do the trick. Apache users won’t have to worry about anything.

2. Editing the config file
Now we need just to make some minor changes to the config file. There are four dvars available for http redirect:
  1. sv_allowDownload (0/1)
    Set this to "1" to permit downloads on your server
  2. sv_wwwDownload (0/1)
    Set this to "1" to permit www downloads.
  3. sv_wwwBaseURL (String URL)
    The URL where your files are (without ‘main’).
    For example: if your files are in http://www.myclan.com/main, the value for this setting should be "http://www.myclan.com".
  4. sv_wwwDlDisconnected (0/1)
    When setting this to "1" it disconnects the client from the server while downloading so it’s not using a slot on the gameserver.

I hope this well help some people getting their HTTP redirect setup correctly. If you have any questions or comments feel free to reply in this thread.
 
Last edited:

BoSBrian

FPSadmin -Crew-
Joined
Sep 9, 2004
Likes
0
Location
Ohio
#2
FANTASTIC post! :salute:

I do believe however that there is one more cvar that needs to be set for the downloads to work properly.

seta sv_allowdownload "1"

I'm pretty sure this cvar needs set whether you're doing a http redirect OR directly from the game server.
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#4
I concur, robert...good job. Also, Brian is correct about the additional dvar.

BoSBrian said:
FANTASTIC post! :salute:

I do believe however that there is one more cvar that needs to be set for the downloads to work properly.

seta sv_allowdownload "1"

I'm pretty sure this cvar needs set whether you're doing a http redirect OR directly from the game server.
 

[us]Wambo

Junior Member
Joined
Apr 24, 2006
Likes
0
#6
I need a little help (well, I need a lot of help, but let's start small)

I have my server running Decoy_02, but the redirect still doesn't work.

When you log on to the server it shows the redirect site, but then switches and starts downloading from the game server.

Any clue what I'm doing wrong

I want the redirect to go here http://wambo.unknownsoldiers.us/
which is my clan ftp space

and here are the changes I made to the server.cfg file

sv_allowDownload "1"
sv_wwwDownload "1"
sv_wwwBaseURL "http://wambo.unknownsoldiers.us"
sv_wwwDIDisconnected "1"

server ip is 69.65.0.60:28960 if you want to see what the problem is.

any help would be great
 
Last edited:

robert

Senior Member
Joined
Jan 7, 2006
Likes
0
#9
Try to rename the 'Main' dir in your webspace to 'main' (lowercase). Just want to clear something out...
 

[us]Wambo

Junior Member
Joined
Apr 24, 2006
Likes
0
#10
Thanks for your help, but that didn't work....

It is working, but that's only because I have the greatest server company out there.

Not only did they get it working for me, but they host the redirect site for me.

Check them out http://www.light-speed.com/
 

Ghost-Ryder

Senior Member
Joined
Nov 18, 2003
Likes
0
#12
What is the DIR to the redirect files?
Where are the Files located on your server (witch folder)?

If you run +fs_game then you need to redirect the download to the same name folder as the +Fs_game folder.

Lets say you name the mod folder AWEMod
+fs_game AWEMod in your command line
so you need to redirect to http://www.ursite.com/AWEMod
It wont look in main if there are not in the main folder on ur server.
 
Last edited:

Diva

Senior Member
Joined
Nov 1, 2003
Likes
0
Location
Seattle
#13
ok i have a question regarding the redirect

if i have my mods and maps on the webserver will it default and download everything from there automatically or do i need to set up seperate lines in the config for each map?

becasue it seems like the mod is being downloaded from the webserver it shows the addy and the map from the server just shows main/map name

Thanks
D
 
Last edited:

xGrunt

Senior Member
Joined
Oct 28, 2005
Likes
0
#14
Only a single redirect line in the config is needed. But as Ghost-Ryder says, you need to pay attention to the directory structure of the download server and make sure the location matches the folder indicated by +set fs_game.

If you're not using +set fs_game, then you would use the /main folder.
 

Lude

Junior Member
Joined
May 24, 2006
Likes
0
#16
Im having a problem setting up my redirect downloads. I did all the steps above, And it shows the site its about to download from (my website) But then is says failed to get download or whatever. I contacted my server provider and they said its something about MIME types? And that .IWD is not a standard MIME type and thus the web server does not know how to handle it. What the hell is a MIME type??:confused:

Thanks. Lude
 

OldDog

Administrator Emeritus
Joined
Oct 31, 2003
Likes
0
Location
Essex Junction, Vermont
#17
Multipurpose Internet Mail Extensions...its the type of files that can be handled by a web, or mail, server. Your web server provider needs to add .IWD as a MIME type. They shouldn't have a problem with it.
 

Butch

Senior Member
Joined
Nov 1, 2003
Likes
0
#18
My Redirects are working. But unlike UO when you join the server all the maps I have must be downloaded before you can play. If I have 6 custom maps all are downloaded instead of just the map playing as my UO redirects work.

Have I missed something here???

I have joined other servers and am forced to DL an arms length of map names.

Is there a fix or is this just another problem that Activison has left us with??

Thanks, Butch
 

xGrunt

Senior Member
Joined
Oct 28, 2005
Likes
0
#19
Yeah, I've been frustrated about this as well. I'm not aware of a fix but would be interested if anyone has any ideas.
 

Tex

Senior Member
Joined
Jan 24, 2005
Likes
0
#20
Yikes

I know when I surf around looking for servers to play in, I won't stick around for monster downloads lol. If it is a server that my friends play on or another clan server I like I will go through all that. I find myself cleaning out the files I have downloaded, if I now I won't be going back to a server or if the server has already moved on to other mods and maps. It is so nice to jump into a server that has maybe on or two maps tops to download. Then they change them out in a couple of weeks. 16K if I am not mistaken is the limit, and I have no clue why they would cap that. That is where a lot of the fun is, and they have cut it down! Help us already IW lift the cap!!!!!!!!!!
 
Top Bottom