I have the following system:
Windows Server ’03
IIS 6 (shoot me)
PHP 5.2.14
Wordpress 3.0.1
WPML 1.8.1.2
I’ve added WordPress to an existing high-traffic site, in a directory we’ll call
For mod_rewrite-like features, I’m using Helicon’s ISAPI_Rewrite 3.1.0.76. I’m using it to enable “pretty” permalinks in the WordPress install. The single rule is this:
RewriteRule ^/wordpress/(?!index.php)(?!wp)([^.]*)$ /wordpress/index.php/$1 [I,L]
I need to add another rule, however, and neither of my dual strategies of thinking it through and bashing it through has borne fruit.
My site is a fully bilingual one. There are no pages that aren’t under one of the two following subdirectories:
http://thehost/en/ for English, and
http://thehost/sp/ for Spanish.
This is a convention I aim to maintain, even for the WordPress install. I currently have a somewhat hacked version of WPML (WordPress Multilingual plugin) operating, and it works such that all pages and postsâregardless of the languageâinclude either the /en/ or the /sp/ in the URL. This has led me to believe I am achingly closeâperhaps only one RewriteRule away!âto making my WordPress URLs conform to the same URL convention as the rest of my site. My problem though, as described, is that I can’t quite get it to work.
So, if I have this URL somewhere in my WordPress install:
http://thehost/wordpress/en/2010/08/omg-this-post-is-in-english/
how can I transform it to
http://thehost/en/wordpress/2010/08/omg-this-post-is-in-english/
while not losing WordPress’s permalinks? I’ve managed to swap the /en/ to its correct location (^/en/wordpress/(.*) /wordpress/en/$1), but I can’t get the two rules to play nicely together. That’s my problem. Well, that and a few others not appropriate for stackoverflow.com.
Thanks for your time.
Try chaining the rules with the “C” Flag. Example: