# BEGIN WordPress # enable the engine RewriteEngine On # we're rewriting in /blog/ RewriteBase /blog/ # if it isn't a file... RewriteCond %{REQUEST_FILENAME} !-f # ...and no directory either RewriteCond %{REQUEST_FILENAME} !-d # rewrite /blog/Main/ to index.php?n_location=Main # RewriteRule ^([^/]+)/?$ /blog/index.php&n_location=$1 [L,QSA] # rewrite /blog/Main/2/ to index.php?n_location=Main&cat=2 # RewriteRule ^([^/]+)/([^/]+)/?$ /blog/index.php&n_location=$1&cat=$2 [L,QSA] # rewrite /blog/1 to /blog/index.php&cat=1 RewriteRule ^([0-9]+)/?$ /blog/index.php&cat=$1 [L,QSA] # rewrite the rest to /blog/index.php RewriteRule . /blog/index.php [L] # END WordPress