RewriteRule ^(?!admin|user|inde\.php|config\.php|%{HTTP_HOST}) %{HTTP_HOST} [R=301.L]
求除了首页及admin目录和user目录以及index.php和config.php 都转跳到首页...
RewriteEngine onRewriteBase /RewriteCond $1 !^(admin\/(.*)|$)RewriteCond $1 !^(user\/(.*)|$)RewriteCond $1 !^(index.php(.*)|$)RewriteCond $1 !^(config.php(.*)|$)RewriteRule ^(.*)$ index.php [L,QSA]
RewriteRule ^(?!admin(/.*)?|user(/.*)?|config\.php)$ index.php
这样能行吗?
重定向都用于不同域名间的转向,实际由浏览器完成
你重定向到自己,不会死循环吗?
仅仅路径不同,那就直接指派就可以了
RewriteEngine onRewriteBase /RewriteCond $1 !^(admin\/(.*)|$)RewriteCond $1 !^(user\/(.*)|$)RewriteCond $1 !^(index.php(.*)|$)RewriteCond $1 !^(config.php(.*)|$)RewriteRule ^(.*)$ index.php [L,QSA]
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号