Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install WordPress in subdomain?

At the moment I have a WordPress installation in a subfolder of my current site (example.com/wordpress). How do I make it so that wordpress is accessible from a subdomain?

I.e. I would like wordpress to be accessible from this address: wordpress.example.com, and that all the links, posts and pages will still work flawlessly, e.g. wordpress.example.com/my-wp-post/

If it makes a difference which host one is with, I am asking specifically about 1&1.

Thank you

like image 629
Aron Avatar asked Feb 13 '14 01:02

Aron


People also ask

Do I need to install WordPress on each subdomain?

If you want to use a subdomain with WordPress, you can either create entirely separate WordPress installs on each subdomain, or you can use a WordPress Multisite network to create separate sites on subdomains that are all powered by the same WordPress install.

How do I move a WordPress site to a subdomain?

Click on the dropdown icon next to the name of your website, then click on staging, and then enter the subdomain you created. That's it. If you prefer not to use this method or your hosting service doesn't use cPanel, you can try using a WordPress plugin.

How do I install WordPress on a subdomain GoDaddy?

Go to your GoDaddy product page. Under Web Hosting, next to the Linux Hosting account you want to use, select Manage. In the account Dashboard, in the Websites section, below the domain where you want to install WordPress select Install Application.

How do I install WordPress on subdomain ionos?

If you want to automatically install and use WordPress with your domain, log in to IONOS and select Domains under My Products. Next, choose a domain that is not in use yet. Click Create Website, and then start the WordPress setup process by clicking Get Started.


2 Answers

I am not a big fan of video tutorials, but I used this one to successfully set up a new subdomain and install wordpress.

Here is an overview of the process

  1. Use cpanel to create the subdomain
  2. Download the latest version of wordpress to your local drive
  3. Upload to subdomain folder on your host
  4. Extract the files, and move them into the subdomain folder
  5. Use cpanel SQL Wizard to create a new data base
  6. Make a note of the username, db name and db password
  7. Copy wp-config-sample.php to wp-config.php in the subdomain folder
  8. Edit wp-config.php to add the username, db name and db password
  9. Open the URL "your-subdomain.your-domain.com/wp-admin/install.php"
  10. Fill out the fields on the form and press "install wordpress"

After creating the a subdomain I use WP clone to create and install a backup of my live site into the new subdomain. The clone site allows me to verify updates before deploying them my public site.

Hopefully the OP has resolved this issue, but maybe this will be of use to others.

like image 91
Eric Laoshi Avatar answered Nov 16 '22 00:11

Eric Laoshi


I think you have 2 options.

1) Manually:

Copy your wordpress install from the subfolder of your main domain to the subdomain's folder. Using a database editing tool (of your choice) go into the wp_options table and change the option_value of the option_name 'siteurl' and 'home'.

You might have a few other options that will need editing, but they are more often than not plugin specific.

2) A little better:

Create a new wordpress install in your subdomain. Copy your plugins, themes and uploads into it. Then, install the plugin wp-migrate-db-pro from https://deliciousbrains.com/wp-migrate-db-pro/ Use this plugin to copy the database from the subfolder install to the subdomain install. This plugin will globally search and replace the URLs and Folders for you.

I've been using this plugin for a while...and it saves me hours and hours of work.

like image 33
Adam Erstelle Avatar answered Nov 16 '22 00:11

Adam Erstelle