Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using Multisite 3.5 Beta3 in a folder - so not the root. It was a pre-existing wordpress blog. I have it set to use sub.domains.com not folders domain.com/sub

My folder looks like this: www/wordpress/ I have the Redirects presented below which it said to put in the .htaccess file in the file (see screen shot here):

www/wordpress/.htaccess

But I think this is wrong. I think it should be in the .htaccess file at

www/.htaccess

This is where they would go with a single install. Am I correct or are the directions correct?

# BEGIN WordPress
# RewriteRules commented out after starting multi site but present prior to
# and carried over from single site.

#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#</IfModule>

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) wordpress/$1 [L]
RewriteRule ^(.*\.php)$ wordpress/$1 [L]
RewriteRule . index.php [L]
# END WordPress

The reason I am asking is because when I added the redirect rules to the .htaccess file it throws in this pretty link: domain.com*/blog/2008/09/02*/post-slug

Under single site my pretty link settings were to have domain.com/post-slug and that is what I want to retain. Well I went to go adjust these in the admin panel and WP kicked me out and made me sign in again. I tried this repeatedly but I get redirected to the login page again. I thought well my password might be bad so I went into phpmyadmin and changed it per the codex but that is no longer the issue. What do I need to do? do the ReWrite Rules need to be inside the <IfModule> tages?

share|improve this question
The bit about the directions was corrected per the WordPress trac log core.trac.wordpress.org/changeset/22982 – Hugh Dec 8 '12 at 5:37

1 Answer

Yes, the .htaccess file should be in the site root - in your case, that would be /www/. You also need to have an index.php file in the site root, containing the following code:

<?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');

The rules tell Apache to look in the wordpress/ folder for any file is a PHP file or is located in the wp-admin, wp-includes, or wp-content folders. The %{REQUEST_FILENAME} rules tell Apache not to apply the rewrite rules if the files physically exist.

share|improve this answer
Right, Thank you for confirming my suspicion regarding the location of the .htaccess file. That location is what I have. As for the code in the index.php, this was a working blog having followed the directions for giving WP its own folder from the Codex codex.wordpress.org/Giving_WordPress_Its_Own_Directory before adding the Multisite stuff. Thank you for taking the time to read and respond, but this answer is not the solution. – Hugh Dec 8 '12 at 2:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.