htaccess 常用命令

作者 by 青柠 / 2021-10-12 / 暂无评论

隐藏 index.php

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

//绑定域名到子目录

# 绑定pan.27a.top 到pan
RewriteCond %{HTTP_HOST} ^pan\.27a\.top$ [NC]
RewriteCond %{REQUEST_URI} !^/pan/
RewriteRule ^(.*)$ pan/$1?Rewrite [L,QSA]

子目录

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^pan\.27a\.top$ [NC]

评论已关闭