Skip to content

Virtual Multiblog and .htaccess

TLDR: RTFM (http://striderweb.com/wp-content/multiblog/multiblog-readme.htm#permalinks)

I had problems with permalinks and Virtual Multiblog (yet another linky), basically that for every wordpress instance I added I would have to add another set of permalink-related Apache Rewrite rules to prevent individual entries 404-ing. This was fragile and prone to failure. Fortunately, there is a Proper Way To Do It:

RewriteEngine On
RewriteCond %{REQUESTURI} (/blog|/news)?/
RewriteCond %{REQUEST
FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . %1/index.php [L]

 

From the readme. Lovely.

1 thought on “Virtual Multiblog and .htaccess”

  1. Hi ! Can you explain better wich problem you was having ?

    My .htaccess is like this and I’m not having strange problems, but I could update it to your version if it’s worth it.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
    RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]

    RewriteEngine On
    RewriteRule ^robots.txt /robots.php [L]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    in robots.php I have this for WP SEO (Joast’s):

    User-Agent: *
    Disallow: /wp-content/plugins/
    Sitemap: http:///sitemap_index.xml

Tell us what's on your mind

Discover more from Rob's Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading