Jump to content

Worpress MU (current ver.) on IIS6 using ISAPI mod_rewrite. help please.


blesseld

Recommended Posts

Hey All,

 

I am attempting to install Worpress mu (multi user) on a windows server 2003 -  IIS6.

 

I have it installed, and the main blog is working, i can log in create users and add new blogs.

 

www.domain.com/blog  -  is the main directory

www.domain.com/blog/another-blog    <---the issue

 

I am using Subfolder for this install not subdomain.

 

So WPMU lets me create the new blog, then i visit the url like :www.domain.com/blog/another-blog  and it gives my my main domain 404 page.  So i take a look and realize that i did not setup the ISAPI mod_rewrite that is needed for IIS.

 

I get setup, and found that I need to paste this line into my wp-settings.php

 

$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];

 

So i did.  Deleted the 2nd blog, and created a new one.  now when i visit: www.domain.com/blog/another-blog

 

I am getting a wordpress 404 page, but the URL is correct,  so one step further,  however, I checked one of the other domains on the server and it broke all site. 

 

ISAPI mod_rewrite says to take the .htaccess file in the root  WPMU directory, copy it's content, and past them into the  ISAPI mod_rewrite directory in the file called  httpd.conf

 

Here is the. htaccess file

 

RewriteEngine On
RewriteBase /blog/

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

 

 

Here is a chunk of code from wp-settings, that talks about IIS

 

// Fix for IIS when running with PHP ISAPI
if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {

// IIS Mod-Rewrite
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
	$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
}
// IIS Isapi_Rewrite
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
	$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
else
{
	// Use ORIG_PATH_INFO if there is no PATH_INFO
	if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) )
		$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];

	// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
	if ( isset($_SERVER['PATH_INFO']) ) {
		if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
			$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
		else
			$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
	}

	// Append the query string if it exists and isn't null
	if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
		$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
	}
}
}

 

 

1. So what I am after is a solution to only affect the one domain: domain.com/blog  and not all domains on the server. 

 

2.  Resolve WPMU 404 error on 2nd blog : www.domain.com/blog/another-blog

 

This is way over my head... i do some PHP for making my websites more efficient but am in no way a programmer, and help would be greatly appreciated.

 

Thanks in advance, and if anyone has an idea and needs more info i'll post.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.