Forum Moderators: phranque
[L] flag to every rule. (.*) at the beginning or in the middle of a RegEx pattern. You might want to use ([^/.]+)\. for root only or (([^/]+/)*[^/.]+)\. for root or folders.
RewriteCond (not needed in your case, unless you want to limit what additional parameters will actually have any effect). HTTP_HOST, SERVER_PORT, QUERY_STRING, THE_REQUEST and a range of other server variables. ?page=xx and you have now re-appended any and all requested parameters to the rewrite target. example.com/foobar?page=22 the numbered page will be served. example.com/foobar?junk=rubbish the main page will be served as Duplicate Content. This non-canonical page should either redirect to the canonical URL or should return the same content but with a rel="canonical" tag or return a 404 response.