正则表达式 – HTACCESS重定向除两个文件以外的所有域
发布时间:2020-12-13 22:56:48 所属栏目:百科 来源:网络整理
导读:我的实际htaccess将我的完整旧站点重定向到我的新站点,我想重定向所有域,但除了两个文件.php(protectetfile1.php和protectedfile2.php). 这是我的htaccess RewriteEngine OnRewritecond %{http_host} ^olddomain.org [NC]Rewriterule ^(.*)$http://newdomain
我的实际htaccess将我的完整旧站点重定向到我的新站点,我想重定向所有域,但除了两个文件.php(protectetfile1.php和protectedfile2.php).
这是我的htaccess RewriteEngine On Rewritecond %{http_host} ^olddomain.org [NC] Rewriterule ^(.*)$http://newdomain.net/$1 [L,R=301]
使用此规则:
RewriteEngine On Rewritecond %{http_host} ^olddomain.org [NC] RewriteCond %{REQUEST_URI} !/(protectetfile1|protectetfile2).php [NC] Rewriterule ^(.*)$http://newdomain.net/$1 [L,R=301] (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |