Question

Change ServerName / VirtualHost configuration:

Hi, I have a wordpress droplet that I set up initially on a domain. I have now changed the domain and it has been working, however now it doesn’t seem to be working at all. Details below:


Initial Domain help.remotefilming.tv

New Domain remotefilming.com


Now when I visit the site I get the message:


Not Found The requested URL was not found on this server.

Apache/2.4.41 (Ubuntu) Server at help.remotefilming.tv Port 443


So you can see it is looking at the initial domain that is not used anymore.

If I run apache2ctl -S I can see the old domain is still registered, here are the results:


VirtualHost configuration:

*:80                   help.remotefilming.tv (/etc/apache2/sites-enabled/000-default.conf:4)
*:443                  is a NameVirtualHost
         default server help.remotefilming.tv (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
         port 443 namevhost help.remotefilming.tv (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
                 alias www.help.remotefilming.tv
                 alias remotefilming.com
         port 443 namevhost www.remotefilming.com (/etc/apache2/sites-enabled/default-ssl.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

Can anyone please help me with removing help.remotefilming.tv so all points correctly to remotefilming.com?

Any help would be greatly appreciated

Thanks


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 18, 2021
Accepted Answer

Hello,

There are a couple of things that you need to do:

  • First make sure that you’ve updated all of the references in your Apache virtual host from the old domain to the new one
  • After that you would also need to issue a new SSL certificate so that your new domain is also secured:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04

  • An important thing that you need to do is to also change the WordPress site and home URLs so that they match the new domain name, otherwise you would be seeing that redirect from the new domain to the old one.

You can do that by adding the following two lines in your wp-config.php file:

define( 'WP_HOME', 'http://remotefilming.com' );
define( 'WP_SITEURL', 'http://remotefilming.com' );

Also a side note but an important one, always make sure to take backups of your website before making any major changes, that way if anything goes wrong, you would be able to revert back to a working version of the site.

Regards, Bobby

Hi Bobby,

Many thanks for your reply. The entire site on the wordpress side is correct including the config file. Also the SSL is setup and correct.

I’m very specifically trying to update the Apache Virtual Host file (your first point), I don’t know how to do this.

The link you sent is more for adding the domain to the Apache, I already have my new domain in place and it is all up and running correctly. I’m trying to clean up the Virtual Host file and remove the old one by udating the file, do you know how to do this?

Many thanks

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.