These instructions will work if you install WordPress in a root sub-folder but want to launch from a root index file. The index file should have the following lines of code:
Code: Select all
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
To load TNG from a WordPress page, create an htaccess file in the root of your website. The htaccess file needs two sections to function correctly. The first section allows the WordPress permalink to find TNG along with a rewrite rule for TNG index.php. The second section contains the WordPress permalink rewrite rules. You will need to modify the wordpress and TNG folder names if they are different in your installation. Use the following code in .htaccess to redirect the WordPress permalink to the TNG folder and load TNG:
Code: Select all
# BEGIN TNG Root Rules
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Redirect rules for TNG folder in root
Redirect /wordpress/tng /tng
RewriteRule ^([^\.]+)$ $1.php [NC]
# END TNG Root Rules
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</IfModule>
If you downloaded the .htaccess file prior to 12-24-17 at 10:00 pm please download the newest version. The WordPress installation will create a .htaccess file inside the WordPress folder which you will not need to modify. Remember to use WordPress pretty permalinks or these rules will not work. Pretty permalinks are anything other than the first option which is "plain".
The remainder of the TNG installation will be the same as that shown in Installing TNG in WordPress. Note when using this configuration, WordPress will be unable to modify the root htaccess file. If you need to make changes to the root htaccess file, you must make them manually.