Sub-domain to redirect to a webpage

May 16, 2014 4.2k views
Hi all, I've been digging around for a while now, but I can't find anything on this. How would I go about creating a sub-domain for my site to redirect to a webpage? For example, I want (with 'help' being the subdomain of course), to redirect users to Is this possible with DigitalOcean's DNS or will I have to accomplish this some other way (by configuring Apache for example)? Thanks!
2 Answers
With Apache, you would most likely use a rewrite in an .htaccess file. Google mod_rewrite to find a plethora of examples.
You need to set a DNS record as well as making some changes to your Apache config. First set a CNAME record:


Then in you Apache config, set up a rewrite rule:

<IfModule mod_rewrite.c>
RewriteEngine on
Options FollowSymLinks
RewriteCond %{HTTP_HOST} ^
RewriteRule ^(.*)$ [L]

This will redirect from the sub-domain to the folder. Let us know how it goes!
  • Tried this but am getting redirected back to the main domain, please help.

    P.S: Am looking to create a sub domain that’d redirect to an external URL.

Have another answer? Share your knowledge.