Forwarding Your Columbia Website to Another Location

While server redirects are frequently the best way to forward one URL/domain to another, sometimes you don’t have access to the website’s host or the host does not allow you to create 301/302 redirects. If this is the case, you can use a javascript snippet to forward any page to another.

The following example is to forward your Columbia homepage to another website. (i.e. forward columbia.edu/~ev2322 to ericvlach.com)

The first step is to connect to the Cunix server. From campus or when connected via VPN, you can connect using a terminal application (i.e. terminal on Mac OSX, or cygwin on Windows, or a bash shell on Linux) and giving the command ssh your-uni@cunix.cc.columbia.edu. For example:

ssh ev2322@cunix.cc.columbia.edu

Navigate to your public_html folder, and edit the index.html file. Paste the code at the bottom of this post into the index.html file, save it, assign it world-readable permissions with

chmod 644 index.html

That should be it! You can test by going to your columbia.edu/~your-uni and seeing if it forwards. (You may have to refresh the page)

If you don’t have a terminal application, you can use an SFTP program. My favorite is FileZilla. You can download it from this page. Install it, and when it asks you to connect, put in cunix.cc.columbia.edu, your UNI, your UNI password, and port 22, and click ‘quick connect’.  It may pop up asking you to confirm a key or some security precaution, you can click ‘continue’.

In a text editor, (I recommend something simple like notepad on windows, or textedit on Mac) create a new file and past the code snippet at the bottom of this post, and save it as index.html (make sure the ending is .html, and choose save as type ‘all files’)

Once you have it saved, drag & drop the newly created index.html file into the right hand side of the filezilla window, into the “public_html” folder.

Finally, right click on the newly uploaded index.html file in FileZilla, and select “File Permissions”. Make sure the “Read” checkbox is checked under all three sections. Click OK, then you can test the setup by visiting columbia.edu/~your-uni (you may have to refresh the page.)

If it still does not work, please contact me and I can troubleshoot.

Here is the code to put in your “index.html” file. Please replace both instances of “redirect.me.here” to your own website:

<script language="javascript" type="text/javascript">
function getGoing(){
   window.location="http://redirect.me.here";
}
//number in setTimeout is in milliseconds, so 5000 would be 5 seconds.
setTimeout('getGoing()',100);
</script>
<a href="http://redirect.me.here">If you are not automatically forwarded, click here</a>