I would like to redirect everything going to
http://www.hogarthian-solutions.ch to chrissandrini.ch which is on the same box.
I tried adding a CNAME record from
www.chrissandrini.ch. but that shows the default page of mail in a box.
;; QUESTION SECTION:
;www.hogarthian-solutions.ch. IN A
;; ANSWER SECTION:
www.hogarthian-solutions.ch. 1800 IN CNAME www.chrissandrini.ch.
www.chrissandrini.ch. 992 IN A 188.8.131.52
I think it is going in circles… from
www.chrissandrini.ch it is forwarded to the box ip which then uses the default page of hogarthian-solutions.ch
I guess I could just modify nginx configuration but maybe there is a built in solution for that.
I suppose you could try making a symbolic link from /home/user-data/www/default to wherever the root of your files for www.chrissandrini.ch are at. I don’t believe you need to deal with DNS settings if I understand that the files are all on a single VPS.
Here is the digitalocean doco on redirects for Apache and Nginx.
I know for sure this works in Apache.
I haven’t tried nginx though MIAB runs nginx.
The DO doco should specify whether the redirect is temporary 302 or permanent 301.
You should in your redirect specify one or the other.
Will a NGINX config change persist after a MIAB upgrade?
Every time I ssh into my
box.domainname.tld I look to see if DigitalOcean/Ubuntu changes are needed. If so, I run:
sudo apt-get update && sudo apt-get upgrade -y
to update my box.
I could very well easily put the CLI stated above in a bash shell script that greps on Apache or Nginx conf to see if there have been any changes to the
redirect 302 and if so reinstate the
There is an undocumented feature to create redirects:
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.