Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @ Thunderbunny.us

    Paste one of the following three different options inside of the wp-404-handler.php file and see which one works for you. I’ve used #1 and #2 in two different blogs. #3 didn’t work.

    Then in the IX control panel add a 404, 404,2 and 404.3 error pages with these two settings: URL and /wp-404-handler.php

    That’s all.

    1:
    <?php
    // This is the default file for the site. Usually index.php
    $default = ‘index.php’;

    // The name of this file.
    // Set this value for the URL in Custom Error Properties of your website in IIS.
    // Goto: IIS Manager > Websites > [Site Name] > Properties > Custom Errors >
    // 404 & 404;2 & 404;3 > URL (Requires a ‘/’ prefix in IIS).
    $thisfile = ‘404-handler.php’;

    $_SERVER[‘ORIG_PATH_TRANSLATED’] = str_replace($thisfile, $default, $_SERVER[‘ORIG_PATH_TRANSLATED’]);
    $_SERVER[‘SCRIPT_FILENAME’] = str_replace($thisfile, $default, $_SERVER[‘SCRIPT_FILENAME’]);
    $_SERVER[‘ORIG_PATH_INFO’] = str_replace($thisfile, $default, $_SERVER[‘ORIG_PATH_INFO’]);
    $_SERVER[‘SCRIPT_NAME’] = str_replace($thisfile, $default, $_SERVER[‘SCRIPT_NAME’]);
    $_SERVER[‘PHP_SELF’] = str_replace($thisfile, $default, $_SERVER[‘PHP_SELF’]);
    $_SERVER[‘PATH_INFO’] = false;

    $qs =& $_SERVER[‘QUERY_STRING’];
    $ru =& $_SERVER[‘REQUEST_URI’];
    $pos = strrpos($qs, ‘://’);
    $pos = strpos($qs, ‘/’, $pos + 4);
    $_SERVER[‘URL’] = $ru = substr($qs, $pos);
    $qs = trim(stristr($ru, ‘?’), ‘?’);

    // Required for WordPress 2.8+
    $_SERVER[‘HTTP_X_ORIGINAL_URL’] = $ru;

    // Fix GET vars
    foreach ( $_GET as $var => $val ) {
    if ( substr($var, 0, 3) == ‘404’) {
    if ( strstr($var, ‘?’) ) {
    $newvar = substr($var, strpos($var, ‘?’) + 1);
    $_GET[$newvar] = $val;
    }
    unset($_GET[$var]);
    }
    break;
    }
    include($default);

    ?>

    2:
    <?php
    $_SERVER[‘REQUEST_URI’] = substr($_SERVER[‘QUERY_STRING’], strpos($_SERVER[‘QUERY_STRING’], ‘:80’)+3);
    $_SERVER[‘PATH_INFO’] = $_SERVER[‘REQUEST_URI’];
    include(‘index.php’);
    ?>

    3:
    <?php
    $qs = $_SERVER[‘QUERY_STRING’];
    $pos = strrpos($qs, ‘://’);
    $pos = strpos($qs, ‘/’, $pos + 4);
    $_SERVER[‘REQUEST_URI’] = substr($qs, $pos);
    $_SERVER[‘PATH_INFO’] = $_SERVER[‘REQUEST_URI’];
    include(‘index.php’);
    ?>

    I use IX WEB HOSTING, and this is what I found out about their their Windwos hosting service and using permalinks:

    “We are sorry for possible inconvenience. In order to use permalinks in wordpress there should be mod_rewrite installed on the server that is only possible on Linux servers with Apache web server. As we have checked your domain is on Windows IIS server that does not have mod_rewrite. I regret, but it is not possible to use permalinks on Windows server. If you really need to use permalinks we would recommend you to move your domain to Linux hosting package.”

    I’m still asking questions, but does this really sound like a satisfactory explanation?

    Does anybody have a different opinion on this issue…

Viewing 3 replies - 1 through 3 (of 3 total)