I have a wordpress site that is extremely large and pushing Wordpress to its limits. It uses a number of pages/categories and a lot of .htaccess rules to organise the various sections of the site, (it's for a large magazine).
One particular issue is really stumping me. I have the following rules in .htaccess ...
RewriteRule ^(cat|tag)/([^\/]+)(/?)$ index.php?page_id=3&s1=$2 [L,QSA]
RewriteRule ^xyz/([^\/]+)(/?)$ index.php?page_id=6&s1=$1 [L,QSA]
Now, if the argument supplied to the cat/tag page has no trailing slash, it always works. If the argument has a trailing slash, and the tag in question matches the entries in a non-Wordpress table that work with the 'xyz' page, Wordpress loads that page instead, even if the tag is present.
I have tested that the rules always work, and they do. Wordpress is always getting the correct $_GET['page'] of 3 and the tag slug as $_GET['s1'], and yet decides to show a different page altogether if the above is true.
Everything is done within .htaccess, permalinks in wordpress are turned off completely. How can I stop WP form deciding against the page_id it has been told to use.