Been spending days on this and hope someone can help. Whenever I add the 3rd rule I can no longer access files that exist. It seems to break rule #1. I added rule 3 to get rid of the equal sign for page numbering. Example: page=1 becomes page1. Everything works fine until rule 3 is added.
RewriteBase /
//1. rewrite only if the requested file is not an actual file on the disk (i.e. file doesn't exist)
RewriteCond %{REQUEST_FILENAME} !-f
// 2. rewrite only if the requested file is not a directory
RewriteCond %{REQUEST_FILENAME} !-d
// 3. rewrite page=no to page1 (this rule breaks 1st rule)
RewriteRule ^(.*)page([^/\.]+)/?$ $1index.php?page=$2 [N,QSA]
// 4. All other requests process through index.php
RewriteRule ^(.*)$ index.php [L,QSA]
Updated.
Never mind, made the following changes with help from another forum and it seems to work.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)page(.*)$ $1index.php?page=$2 [QSA,L]
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]