为什么这个路由没有通过htaccess使用友好的url slug风格正确

My current .htaccess:

RewriteEngine On
RewriteBase /myproject/

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME}.php -f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^([^/]+)$ $1.php [QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?r=$1 [QSA]

If I write:

/?r=page1 (Page1 is just an example in this context). : WORKS

/page1 : DOESN'T WORK, DISPLAYS 404 ERROR

What's wrong with my .htaccess?

The following line solved it:

RewriteRule ^([^?]*)$ index.php?r=$1 [QSA]