From the Landing Pages plugin, I have a page I want to use as my home page:
forums.mysite.com/landing
-
So when people go to mysite.com
or www.mysite.com
I want them to be taken to forums.mysite.com/landing
.
Now, if someone makes a typo and goes to forum.mysite.com/landing
(no “s” in “forums”), I want them to be taken to forums.mysite.com
.
In my app.yml file for Discourse, I have it set up like:
after_web_config:
- replace:
filename: /etc/nginx/nginx.conf
from: /sendfile.+on;/
to: |
server_names_hash_bucket_size 64;
sendfile on;
- file:
path: /etc/nginx/conf.d/forumsredirect1.conf
contents: |
server {
listen 80;
server_name mysite.me;
return 301 $scheme://forums.mysite.me/landing$request_uri;
}
- file:
path: /etc/nginx/conf.d/forumsredirect2.conf
contents: |
server {
listen 80;
server_name www.mysite.me;
return 301 $scheme://forums.mysite.me/landing$request_uri;
}
- file:
path: /etc/nginx/conf.d/forumsredirect3.conf
contents: |
server {
listen 80;
server_name forum.mysite.me;
return 301 $scheme://forums.mysite.me$request_uri;
}
On my domain’s DNS record, I have:
Is all of this correct? I assume not because currently, when I go to mysite.com
, it’s a dead page. However, www.mysite.com
properly redirects me, BUT not to my /landing
page, only the base forums.mysite.com
page, and that’s only somewhat working, I assume, because of the DNS record on my domain host and not my VPS app.yml file…Help?
Can I add more than one hostname here (my base domain name) so that it works or what’s going on here?