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 help.mydomain.com (with ‘help’ being the subdomain of course), to redirect users to mydomain.com/support.
Is this possible with DigitalOcean’s DNS or will I have to accomplish this some other way (by configuring Apache for example)?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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: <br> <pre> <br>.mydomain.com. IN CNAME @ <br> </pre> <br> <br>Then in you Apache config, set up a rewrite rule: <br> <br><pre> <br><IfModule mod_rewrite.c> <br> RewriteEngine on <br> Options FollowSymLinks <br> RewriteCond %{HTTP_HOST} ^help.mydomain.com <br> RewriteRule ^(.)$ mydomain.com/support [L] <br></IfModule> <br></pre> <br> <br> <br>This will redirect from the sub-domain to the folder. Let us know how it goes!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.