RewriteEngine On
RewriteBase /
RewriteRule ^()$ index.php [NC,L]
Rewritecond %{REQUEST_URI} !(^/?.*..*$) [NC]
RewriteRule (.*)$ $1.php [NC]
ErrorDocument 404 /index
RewriteEngine On
RewriteBase /
RewriteRule ^()$ index.php [NC,L]
Rewritecond %{REQUEST_URI} !(^/?.*..*$) [NC]
RewriteRule (.*)$ $1.php [NC]
ErrorDocument 404 /index
RewriteEngine on
# 把 yourdomain.com 改为你要绑定的域名.
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
# 把 subfolder 改为要绑定的目录.
RewriteCond %{REQUEST_URI} !^/subfolder/
# 不要改以下两行.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 把 subfolder 改为要绑定的目录.
RewriteRule ^(.*)$ /subfolder/$1
# 把 yourdomain.com 改为你要绑定的域名
# 把 subfolder 改为要绑定的目录.
# subfolder/ 后面是首页文件index.php, index.html……
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]