Hi guys,
I use Wordpress as a CMS, where the front page is static for the most part and the actual blog part of it has been moved to a new page that uses a custom page template that basically acts as if it were the front page on a standard Wordpress install. It works pretty well but it still has a few bugs. The main one is that pagination will no longer work, Wordpress won't recognize the page URLs that are generated.
So far I've configured Wordpress to display the correct URLs (domain.com/blog/page/2 instead of domain.com/page/2), and I've also gotten it to display a specific page of blog posts via a URL parameter (domain.com/blog?page=N). So basically I'm almost done, I just need to map domain.com/blog/page/N to domain.com/blog?page=N. This would be an easy task if it were just a plain old static site, but Wordpress has it's own URL handling that I believe may be interfering with it - not to mention "blog" isn't an actual URL so it needs to go through the rules twice, once for mapping the blog pagination, and once again so Wordpress can handle the generated URL as it would regularly... I think I may need to use the N or NS flags for the rewrite rules but I just don't know how I would use them
The rule I've come up with:
RewriteRule ^/blog/page/([0-9]+)$ /blog?page=$1
Default Wordpress .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
As per some suggestions, I've gotten this for the .htaccess, but it still doesn't recognize it.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule /blog/page/([0-9]+)$ /blog?page=$1 [N,QSA]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
And I'm fairly certain changing the page via the URL parameter does work - I change the number in the URL manually and it does in fact change the page. The web server is LiteSpeed, if that makes any difference