Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tech:linux:creating_wordpress_websites_on_ub1 [2014/11/15 09:13]
tech:linux:creating_wordpress_websites_on_ub1 [2014/11/15 09:13] (current)
Line 1: Line 1:
 +====== Creating WordPress Websites ======
 +This is different from creating wordpress websites in general. Why? Because this is a single install with single database (a set of tables for each website) approach. This reduces the number of installs and locations and keeps maintenance simple across all wordpress websites. There is a different application for wordpress farm that does this - however I am making my own cup of tea here because I like it that way.
 +
 +===== Location =====
 +==== Main Folder ====
 +A sample folder where wordpress is installed:​\\
 +/​www/​common/​vcs/​wordpress/​
 +==== Config file ====
 +wp-config.php
 +==== Change Required ====
 +Open wp-config.php and go to the long list of case statements as below:
 +<code php>
 +$table_prefix = '​unknown';​
 +switch ($_SERVER[SERVER_NAME])
 +{
 +    case "​example.com":​
 +         ​$table_prefix ​ = '​wp01_';​
 +         ​break;​
 +    case "​www.example.com":​
 +         ​$table_prefix ​ = '​wp01_';​
 +         ​break;​
 +    case "​bread.example.com":​
 +         ​$table_prefix ​ = '​wp02_';​
 +         ​break;​
 +    ...
 +</​code>​
 +Assign a table prefix (in this case the pattern is wp//nn//_) and copy the three line block over
 +
 +==== Change Settings ====
 +Since the default setting (for some reason) established the wordpress site as SSL site and also because you will need to setup permalinks make sure you log in as admin and setup permalinks, etc.  ​
 +
 +=== Permalinks settings ===
 +Under Settings --> Permalinks choose Custom Structure and enter <​code>/​%post_id%/​%postname%/</​code>​
 +
 +=== Google xml sitemap settings ===
 +Using the Google XML Sitemaps Plugin customize the location of the sitemap xml file as below. You may need to create the sitemaps directory in the root WordPress directory.
 +<​code>​
 +Custom Location:
 +/​path/​to/​wordpress/​sitemaps/<​THE SITE NAME>​.xml
 +http://<​SITE URL>/​sitemaps/<​THE SITE NAME>​.xml
 +</​code>​
 +So as an example, if your side is example.com:​
 +<​code>​
 +Custom Location:
 +/​path/​to/​wordpress/​sitemaps/​example.com.xml
 +http://​example.com/​sitemaps/​example.com.xml
 +</​code>​
 +
  

QR Code
QR Code tech:linux:creating_wordpress_websites_on_ub1 (generated for current page)