The MU forums have moved to WordPress.org

Is there absolutly no way to make this work on IIS (20 posts)

  1. neo4650
    Member
    Posted 16 years ago #

    Its a pain to me that the greatest Blog software of times is only avalible for apache.

    Im desperatly trying to get it to work on IIS. All seems to work fine... users can register new blogs sadly though the system does not create the new blogs ie. if i register a new blog with user test and blog name test "blogservice.dk/test" nothing is created, i can allthough active the blog ?? Ive installed IIS_rewrite mod prof. on the site.

    Users and blogs appear in the admin section, so i cant seem to spot the problem why no blog site is created.

    If anyone has any idear about how or what i could try to get i working i would be very gald.

  2. neo4650
    Member
    Posted 16 years ago #

    Just read on the Web that the biggest problem IIS has is the permalinks IE Mod_rewrite function. A dude created this to fix that problem.

    http://www.binaryfortress.com/wordpress-url-rewrite

    Should take care of the problem with Url-rewrite.
    Could this be my problem. that users cant see their blogs because Url-rewrite isnt working porberly ?

  3. Craig3
    Member
    Posted 16 years ago #

    Take a look at this:

    Clean Permalinks on IIS using .htaccess

    I tried it on wordpress-su and it worked perfectly. Although it should work for wordpress-mu too, I couldn't test it because I can't even login and create a blog site :(

  4. neo4650
    Member
    Posted 16 years ago #

    Thx ill try that, and report back

  5. MrWize
    Member
    Posted 16 years ago #

    I can say this:

    IT WON'T WORK!

    I've tried "them all", "rewrites for iis". Both commercial and free.

    Binaryfortress WP UrlRewrite works perfectlly on a normal, single, wordpress-blogg but not with WP MU.

    IIS Mod-Rewrite PRO don't do the work either wit WP MU on windows 2003 web edition. I tried both subdomaining and subfoldering ... :(

    If there is SOMEONE! that have got it to work, please, post the solution here.

    /Patrik

  6. man999
    Member
    Posted 16 years ago #

    I had a heck of time to get PHP and WPMU work together on IIS, but I finally got everything working perfect after following Craig's link.

    Summary:

    1. Install PHP 5.2.0 (could not get it work with later versions).
    2. Install IIS Mod-Rewrite Pro.
    3. Create an empty database in MySQL for WPMU.
    4. Copy WPMU files to webserver's root.
    5. Insert the code line below at the beginning of index.php

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

    6. Grant IIS full access rights on webserver's root directory, so that WPMU install can create wp-config.php and .htaccess files.
    7. Run WPMU install by hitting wpmu main url ( for example http://yourserver/ or http://yourserver/wpmu )
    8. Type in database and other settings and submit (I chose "subdirectory" blogs instead of "subdomain" blogs). I everything works fine, you are done with installation.
    9. Click "Create new blog" to create a new blogsite with your own admin account.

    Hope you get it working too. Good luck!

  7. man999
    Member
    Posted 16 years ago #

    Hmm, after a bit more testing, it looks that I'm having serious problems with WPMU on IIS.

    I can create new blogsites, I can get all permalinks working fine, but every blog or comment I post is saved in the main blog. Also, in admin panel, no matter which blogsite I select from the list, the main blogsite is chosen.

    Any help is appreciated.

  8. lunabyte
    Member
    Posted 16 years ago #

    Apache.

  9. man999
    Member
    Posted 16 years ago #

    Good news!

    With all settings above, but choosing subdomain (vhost) based blogs instead of subdirectory based, everything works perfect :-)

  10. man999
    Member
    Posted 16 years ago #

    Even better news!

    It looks that I found the hack. Instead of index.php, copy the following line of code at the beginning of wp-config.php

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

    Now, everything works perfect with both subdirectory and subdomain based blogs.

  11. lunabyte
    Member
    Posted 16 years ago #

    Even better news... Steve Balmer and Co. end up behind bars. :D

  12. MrWize
    Member
    Posted 16 years ago #

    man999,

    only that didn't work for me with IIS MOD-Rewrite PRO (or ISAPI_Rewrite3). I had to change some code in wp-settings.php. Why? I have a WPSU running perfectly with only adding
    $_SERVER[ 'REQUEST_URI' ] = $_SERVER[ 'HTTP_X_ORIGINAL_URL' ];

    I open up the WPSU wp-settings.php and found some differences with wp-settings.php for WPMU. In WPMU it looks like this:

    // Fix for IIS, which doesn't set REQUEST_URI
    if ( empty( $_SERVER['REQUEST_URI'] ) ) {
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; // Does this work under CGI?

    // 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'];
    }
    }

    and for WPSU 2.3 wp-settings.php it looks like this:

    // Fix for IIS, which doesn't set REQUEST_URI
    if ( empty( $_SERVER['REQUEST_URI'] ) ) {

    // 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 {
    // If root then simulate that no script-name was specified
    if (empty($_SERVER['PATH_INFO']))
    $_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/';
    elseif ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
    // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    $_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'];
    }
    }
    }

    Just put that code into WPMU wp-settings.php (don't forget wp-config.php code above) and it will work PERFECTLY! ... except one small thing ... no UPPERCAPS in blogname/username. You can change that in wpmu-functions.php. Search for [a-zA-Z0-9 .... remove A-Z and also that problem is solved.

    Remember ... I'm not a php-coder, just a "cut and past PHP-coder" *|o|*

  13. MrWize
    Member
    Posted 16 years ago #

    Oh ... forgot one thing. The .htaccess file for IIS Mod-Rewrite PRO looks like this:

    # BEGIN WordPress

    Options Indexes
    Options FollowSymLinks
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^www\.domain.tld
    RewriteRule ^(.*)$ http://domain.tld/$1 [R=permanent,L]

    RewriteBase /

    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [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]

    # END WordPress

  14. man999
    Member
    Posted 16 years ago #

    Hi MrWize,

    You solution sounds even better. Thanks! It's also appears that Wordpress developers want to natively support the mod_rewrite compatible ports for IIS, which is great.

    BUT, when I tried this code it couldn't work with either WPMU or WPSU. After a lot of testing on my IIS, I found that the server variable REQUEST_URI is NOT empty, but instead it contains the rewritten url (/wordpress/index.php). The condition

    if ( empty( $_SERVER['REQUEST_URI'] ) ){...}

    is "false" and the replacement of REQUEST_URI with the originally requested URL cannot work. Therefore I still have to use

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

    outside that condition to get everything work with IIS Mod-Rewrite pro.

    I'm not sure if it's PHP or IIS that causes this. I'm using IIS 6 and tried both PHP 5.2.0 and 5.2.4. Does anybody have any clue about this behavior?

  15. MrWize
    Member
    Posted 16 years ago #

    Ok ... did You change added the code into wp-config.php as described above?

    I don't have PHP v5.x.x installed. I use PHP 4.4.4 on my production and development server. That could be the difference. I will try to update to PHP v5.x.x in the beginning of next year. have to testrun it deeply on my development server first before I can go Live with such an update.

    /Patrik

  16. man999
    Member
    Posted 16 years ago #

    I suspect too that it's the PHP version that causes the problem. I think I've heard about that somewhere.

  17. dandrade
    Member
    Posted 16 years ago #

    I want to install MU. I use IIS and had been runing WP SU, now and I want MU. Can someone summarize what is needed so far to run on IIS.

    Also, is this mod_rewrite a must?

  18. lunabyte
    Member
    Posted 16 years ago #

    Yes, mod_rewrite is required. Thus, which some folks have managed to get it to work on IIS, it isn't recommended.

    If my understanding of the efforts of those who have managed to get it working, they had to purchase an additional package/filter for IIS.

  19. andrewbillits
    Member
    Posted 16 years ago #

    Trust me, you don't want to run WPMU on IIS unless you absolutely have to. It's much more trouble than it's worth.

    Thanks,
    Andrew

  20. man999
    Member
    Posted 16 years ago #

    Dandrade,

    If you look earlier in this thread, I've posted a tasklist with 9 steps. Just in step 5 consider wp-settings.php instead of index.php. Also, there is an update for step 1: I tried php 5.2.4 worked fine.

    Although this solution worked for me on IIS without a hitch, I would recommend Apache.

    Finally, you got to pay for a mod_rewrite compatible tool for IIS such as IIS Mod-Rewrite Pro. The specific one, is trial so make sure you try the solution before you pay any $$.

About this Topic