404 Broken Permalinks with IIS / ISAPI rewrite

Summary

When using a “pretty” permalink structure with IIS / ISAPI rewrite, all Shopp storefront URLs cause 404 “Page not found” errors.

Symptoms

When using an /index.php/ stubbed permalink structure with Shopp, all the Shopp storefront URLs are missing the necessary /index.php/ stub, causing the request to end in a 404 “Page not found” error.

Error Message(s)

404 - File or directory not found.

Impacts

Shopp Version: 1.2 – 1.2.3
Web Server: IIS6
Server OS: Windows

Known Causes

WordPress does not include the /index.php/ in the home_url().

Work Arounds

Add the following filter to your WordPress theme’s functions.php file:

add_filter('shopp_url','fix_index_php_permalinks');
function fix_index_php_permalinks ( $url ) {
    $structure = get_option('permalink_structure');
    if ( 0 === strpos($structure,'/index.php/') ) {
        $scheme = (false === strpos($url, 'https://') ? 'http' : 'https' );
        $url = str_replace( home_url('/',$scheme), home_url('/',$scheme).'index.php/', $url );
    }
    return $url;
}

Bug Ticket

#1915

See Also

404 Broken Permalinks with IIS / ISAPI rewrite
  • 0.00 / 5 5

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.