How do I format this htaccess rule to not redirect a specific query?
<p>I am using an htaccess rule to redirect all urls in the format of:</p>

<p>www.example.com/blog/the-name-of-the-post</p>

<p>to</p>

<p>www.example.com/the-name-of-the-post</p>

<p>So I've removed "blog" from the URL. The redirect rule below is working. However I do not want to redirect any URLs in the format of:</p>

<p>www.example.com/blog/page/x</p>

<p>So if "/page" appears after "blog", then I don't want to do the redirect. The problem is I'm also redirecting the blog pages when paginated.</p>

<pre><code>RedirectMatch 301 ^/blog/([^/]+)/([^/]+)/$ https://www.example.com/$2
</code></pre>

<p>In sum,</p>

<p>www.mysite.com/blog/the-name-of-post redirects to www.example.com/the-name-of-post</p>

<p>www.example.com/page/1 (or page/2, page/3, etc) do not redirect</p>

<p>Thanks</p>