bigjohnny
By:
bigjohnny

How do I go about making a subdomain appear to be a subfolder?

August 2, 2017 83 views
Deployment CentOS

I'm trying to find out how to make a subdomain appear as a subfolder ie:

if I have -

forum.example.com

but I want to browse to -

example.com/forum

to find it rather than have it available at forum.example.com

also - how would I work this with SSL?

should I add forum.example.com to the certificate? or would it be covered under example.com?

Thanks for any pointers!

Johnny

1 Answer
hansen August 2, 2017
Accepted Answer

Hi @bigjohnny

Are you using Apache or Nginx?

If you don't want to use forum.example.com anymore, then you can setup redirects to example.com/forum/
And then you only need to add HTTPS to example.com since you're not going to actively use forum.example.com

  • Hi @hansen I'm using Nginx..

    I haven't even set it up yet, so I am not using forum.example.com at all, but deploying with dokku I think its easiest to deploy the app to that subdomain.

    Thanks for the advice, redirecting seems like a pretty easy option as well,

    Cheers,

    Johnny

    • @bigjohnny

      I would recommend that you set it up like it should work. So take advantage of Nginx's simple configuration structure and use the location /forum/ { ... } for the Dokku app instead of it's own server { ... } block.

      • OK - not sure how I'd do that but will look into it and give it a try

        Thanks!

        Johnny

        • @bigjohnny

          When you got some configuration to show, then post it here if you want help.
          It's almost the same configuration - just instead of having the entire server block you would only use the location and specific proxies/etc for that location.

Have another answer? Share your knowledge.