1

I am a freelance videographer/developer, and part of my job involves transferring large files over FTP to production houses/television stations. While the majority of people in my industry understand the difference between FTP and HTTP, I've experienced several interactions in the past couple months of people who still open Internet Explorer and try to access http://ftp.mydomain.com, receive an error page served by HostGator, and tell me that they cannot access my FTP server.

Instead of spending time delivering instructions via e-mail, I'd much prefer to serve up a custom error page in this instance that instructs them how to download and use an FTP client.

I tried setting up a sub-domain in Cpanel hoping I could simply drop in an .htaccess file with the error page, but I got this error:

ftp.mydomain.com domainadmin-domainexistsglobal

I also tried creating a custom error page in PHP which reads the site URL and serves up the custom content only when http://ftp.mydomain.com is accessed. Unfortunately, the error page works for every subdomain except that one.

I'm not entirely sure this is even technically possible, which is why I bring it to the good people of StackOverflow to help. Thanks!

  • shouldn't this be only ftp.mydomain.com , instead of http://ftp.mydomain.com? – Satya Oct 01 '12 at 14:36
  • I'm not sure I understand your question... –  Oct 01 '12 at 14:40
  • I mean that people who are trying to ftp from your sire should access via ftp.mydomain.com instead of http://ftp.mydomain.com – Satya Oct 01 '12 at 14:44
  • @Satya is saying you should access ftp.mydomain.com over the ftp protocol rather than http. –  Oct 01 '12 at 14:45
  • Well, I think he knows but his clients don't, that's why he wants to explain it to those, who call it via http instead via ftp. –  Oct 01 '12 at 14:48
  • Can you edit the DNS-zone-file of your "myadmin.com" zone? If so, you could try to remove the "ftp"-entry in the zone (make a note on what the current settings are before you remove it), and then try to add the "ftp" sub-domain. If it works, check if the `ftp` entry in the zone is like before (just to be sure). – vstm Oct 01 '12 at 14:49
  • @vstm That did it! Being a complete n00b at posting on Stack Overflow, I'm not sure how to mark yours as correct... –  Oct 01 '12 at 15:21

1 Answers1

1

It seems you are not allowed to admin your subdomain "ftp" hence you cannot control what is displayed when it is called via http.

You could add another subdomain, e.g. myftp.mydomain.com. Tell your clients that the ftp-server address is this instead of ftp.mydomain.com. I suppose, that all subdomains, inlcuding the generic ftp one, resolve to the same host.

Then if you are using an Apache server and are allowed to use mod_rewrite, a .htaccess file in your subdomain's directory with following content should do the trick and redirect to www.mydomain.com/how-to-ftp.html

RewriteEngine On
RewriteCond %{HTTP_HOST} ^myftp\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/how-to-ftp.html [R=404,L]
  • You should get it a 404, not a 301. – Alvin Wong Oct 01 '12 at 14:49
  • Not exactly what I'm looking for... I'd rather give all of my clients the correct information (e.g. credentials for `ftp.mydomain.com`) and if a few of them try to access it through a browser, I want to then serve them the error page. –  Oct 01 '12 at 15:20
  • Well as I said I think you won't be able to change the http output of `ftp.mydomain.com`. And I also bet, that credentials for `ftp` will work on `myftp`, too. –  Oct 01 '12 at 15:22