You need to make sure that when matching with ^article\.php$ , this is from the actual request, and not from the URI that was rewritten by the previous rule. Thus, you can either add an ENV check for internal redirects, or match it with `% {THE_REQUEST}.
Your choice:
RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{QUERY_STRING} ^id=([0-9]{1})$ RewriteRule ^article\.php$ /article/%1 [L]
or
RewriteCond %{THE_REQUEST} \ /+article\.php\?id=([0-9]{1})(\ |$) RewriteRule ^ /article/%1 [L]
source share