I have a folder and file structure already in place for a site to which I am inserting WordPress. My goal is to execute WP at the root level (/) when a visitor just visits the domain without a path, however I want WP to be installed within the wordpress
subfolder folder.
So far I've reviewed several hits on this, but every single one of them appear to have the negative side effect of pushing the user on over to http://mydomain.tld/wordpress rather than keeping the user on /.
How can this be accomplished? I am guessing it is going to take some massaging of .htaccess in both the root folder and the other subfolders to which I want to grant access aside from WordPress, but I'd like to see this delineated properly.
One thing I have tried is to follow the Codex suggestion "Pointing your home site's URL to a subdirectory". In this I have updated my .htaccess
as per what is there, however the site is consistently redirected to http://mydomain.tld/wordpress
. I obviously want it to just be mydomain.tld
without the additional wordpress path.
I have further attempted to do the following, with the mydomain.tld
loading up the wordpress blog, but then seemingly when I go to any page, such as the default sample page that is installed with a fresh installation, it then adds the subfolder path again mydomain.tld/wordpress/blah
:
in /index.php
:
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wordpress/wp-blog-header.php');
and /.htaccess
:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
Also, the wp_options
table siteurl has http://mydomain.tld/wordpress
in it as well.
.htaccess
, are you running MS?