Debugging order of RewriteRules

I’ve got a set of RewriteRules which are working fine on a WordPress site with the exception of paginated content. I’m trying to add in a rule for the pagination but it’s not working, leading me to think it’s either the execution order that’s the problem or that the page I’m rewriting to is incorrect.

Can anyone point me in the right direction to a solution?

Read More

The site currently works as follows:

http://domain.com <– Homepage

http://domain.com/blog/ <– Blog landing page, displaying WP loop of x blog posts

http://domain.com/example-blog-post <– Blog post

Background info

Previously WordPress was installed into a “blog” sub directory, this was then moved out to the domain root hence the other rules. I’ve noted my addition on line #9 below:

## Moved blog landing page to a subdir
RewriteRule ^blog/(.+)$ /$1 [R=301,L] 

## Redirect legacy urls to domain root
RewriteCond %{REQUEST_URI} ^blog/? [NC]
RewriteRule ^blog/(.*)$ http://www.domain.com/$1 [R=301,L]

#### My addition ####
RewriteRule ^blog/page/$ /blog/?paged=$1 [L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Related posts

Leave a Reply