• Hi,

    We have a hybrid site — half of it is in WordPress (network install) and the other half is plain HTML files. Eventually we’ll get rid of the plain HTML files and run everything in WordPress.

    For the plain HTML stuff, we have mod_speling turned on. We’re doing this because we migrated from a case-insensitive file system a few years ago and our old-ish URLs were always case-insensitive. mod_speling handles this well.

    More about mod_speling:

    http://httpd.apache.org/docs/2.2/mod/mod_speling.html

    The default WP htaccess files did not play well with mod_speling.

    In order to get this to work, I had to modify the .htaccess rules that redirects requests to WordPress. I had to put some rewritecond statements in – one for each blog – and only redirect those requests.

    Like this (for WPMU 2.9.2):

    #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]
    
    # add one entry per blog
    RewriteCond %{REQUEST_URI} ^/site1(/)?(.*) [OR,NC]
    RewriteCond %{REQUEST_URI} ^/site2(/)?(.*) [OR,NC]
    RewriteCond %{REQUEST_URI} ^/site3(/)?(.*) [OR,NC]
    RewriteCond %{REQUEST_URI} ^/site4(/)?(.*) [OR,NC]
    #more rewriteCond's here - one for each blog/site
    RewriteRule . index.php [L]

    As we add more blogs, we have to add more rules.

    Like I said, this seems to work fine. Perhaps if it ain’t broke, I shouldn’t try to fix it. But, having said that…

    Can anyone think of a better way to do this?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Eventually we’ll get rid of the plain HTML files and run everything in WordPress.

    Do that. 😀

    Thread Starter Bill Dennen

    (@xyzzy)

    Ok ok. Yes, you’re right of course. Perhaps this is short-term pain, and we’ll all be happy in the end.

    I’d also like to turn off mod_speling, which would solve this problem, but would create other problems.

    Thread Starter Bill Dennen

    (@xyzzy)

    This approach of adding rewritcond statements does have some advantages. Only certain requests are sent to WordPress for processing.

    So, if somebody requests some wacky URL (not one being redirected to WordPress) and it’s a 404 — there’s no additional overhead of going to WordPress just to deliver a 404 page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Network install with mod_speling turned on’ is closed to new replies.