There are a variety of ways to do this. This one applies the rule to any non-existent file:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L]
Edit: You may have to add RewriteEngine on
at the top, and this goes in .htaccess
in your web document root. All of this, of course, depends on whether use of htaccess (mod_rewrite) is allowed by your web host and whether the rule override file should be named .htaccess. Both are pretty common though, so it shouldn't be a problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…