How do I set up a CoD4 web redirect?

CoD, CoD2, CoD4, and CoD:WaW
Post Reply
User avatar
Edge100x
Founder
Founder
Posts: 12945
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

How do I set up a CoD4 web redirect?

Post by Edge100x »

:!: We recommend only following this guide if you are using your webhosting here to host a redirect for a server at a different host. If your CoD4 server is hosted here, it is much easier to use the tool on the "Websync" page of your control panel.

In a nutshell, to do this you must create a directory structure on your web space that almost matches the one on the game server, but is restricted to just the "usermaps" folder and the folder for your mod, and then you must set a variable in the "server.cfg" file so that the game knows where to look for these hosted files.

1. Add a subdomain or domain to use for the redirect through the Domains page of your website's control panel, if you have not done so already.

2. Log in to the website's FTP (using the information given on the website's File manager page) and create a directory called "server" within the folder that you pointed your domain/subdomain to. Within this directory, create two folders, called "usermaps" and "mods" (all lowercase). Inside the "mods" directory, create another directory named according to your mod -- that is, one that matches the folder name that you use under the Mods folder on your game server. To run custom maps on your CoD4 server, you must use a mod.

3. Upload all the ".ff" and ".iwd" files from your mod's folder to the corresponding "/server/mods/yourmod" folder on your website, where "yourmod" means the mod directory that you just created in step #2.

4. Upload the contents of the "/usermaps" folder on your game server to the "/server/usermaps" folder on your website, preserving pathnames. That is, just like on the game server, you should have a directory named for each map and inside that map's directory you should have its required ".ff" and ".iwd" files.

5. Download the server.cfg that you use on the game server (making sure it is the one in "Mods/yourmod" and not the one in "main") through its FTP and open it up in your favorite text editor. It should contain these lines:

// HTTP / Downloading (For use with Custom Maps and Mods)
set sv_allowdownload "1"
seta sv_wwwDownload "0"
seta sv_wwwBaseURL ""
seta sv_wwwDlDisconnected 0

If not, create them. Change the sv_wwwBaseURL variable to match the address to your website's "server" folder and the sv_wwwDownload value to 1, like so:

// HTTP / Downloading (For use with Custom Maps and Mods)
set sv_allowdownload "1"
seta sv_wwwDownload "1"
seta sv_wwwBaseURL "http://yourwebsite.nuclearfallout.net/server"
seta sv_wwwDlDisconnected 0

6. Save and upload the modified server.cfg to your game server FTP, then restart the game server.

As a specific example, if I run a mod called "edge", and use a map called "mp_edge", my website's folder structure would look like this:

Code: Select all

server
  usermaps
    mp_edge
  mods
    edge
The "mp_edge" directory would contain the map files from "mp_edge", and the "edge" folder might contain "mod.ff" and "z_edge.iwd".

If you are having trouble with the redirect after you have followed these steps, check the access log at the bottom of your website tab. It will tell you what the game is trying to have people download with lines like this:
123.123.123.123 - - [16/Jun/2008:23:12:35 -0700] "GET /server/usermaps/mp_edge/mp_edge.iwd HTTP/1.1" 404 322 "-" "ID_DOWNLOAD/1.0 libwww/5.3.1"
The bolded path and filename is what the server was looking for. The bolded "404" means that the webserver returned a "file not found" error. The bolded "ID_DOWNLOAD/1.0" tells us that this was a resource requested by someone's game client and not a regular web browser. From this information, I can tell that I either mis-created the path to "mp_edge" on the website or forgot to upload the "mp_edge.iwd" file there.
Post Reply