By evd
sub.mysite.com is hosted here on DO. mysite.com is hosted somewhere else.
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!
If you’re using Apache, you can use Rewrite rules to rewrite sub.example.com/forum to sub.example.com.
You can add following to your Virtual Host or .htaccess for sub.example.com:
RewriteEngine on
RewriteRule ^forum/(.*)$ $1
If you changed via Virtual Host make sure restart Apache after change. If you go with .htaccess, make sure it’s enabled.
This will ‘just remove’ forum/ part from your link.
If you decide to go with Virtual Host change, it will look something like:
<VirtualHost *:80>
ServerName sub.example.com
RewriteEngine on
RewriteRule ^forum/(.*)$ $1
. . .
</VirtualHost>
You can find virtual hosts files in /etc/apache2/sites-available. Default file is 000-default.conf.
You can also go with redirection, but rewrite rules should be more suitable.
If you use nginx, I can write down instructions too, if needed.
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.