Network install with mod_speling turned on
-
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:
https://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!
- The topic ‘Network install with mod_speling turned on’ is closed to new replies.