Place the following in your .htaccess
file:
RewriteEngine on
# The two lines below allow access to existing files on your server, bypassing
# the rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?p=$1 [QSA]
You can then access whatever
from example.com/whatever
like the following:
$value = $_GET['p']; // "whatever"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…