重定向所有,但几个请求
问题描述:
我一直在转发我的域名scotnery.com jugglegood.com很长一段时间。现在,我想在scotnery.com(索引页面)上用css,img和js托管一个页面。我想将所有其他请求重定向到jugglegood.com,因为有些网站可能链接到“scotnery.com/tv”,我想将它发送到“jugglegood.com/tv”重定向所有,但几个请求
这里是我当前的htaccess文件在scotnery.com这不是为我工作和看似复杂
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/img/.*
RewriteCond %{REQUEST_URI} !^/img$
RewriteCond %{REQUEST_URI} !^/css/.*
RewriteCond %{REQUEST_URI} !^/css$
RewriteCond %{REQUEST_URI} !^/js/.*
RewriteCond %{REQUEST_URI} !^/js$
RewriteCond %{REQUEST_URI} !^/img/.*
RewriteCond %{REQUEST_URI} !^/img$
RewriteCond %{REQUEST_URI} !^/(index|other-page)\.php
RewriteCond %{REQUEST_URI} !^/
RewriteRule .* http://jugglegood.com/ [R=301,L]
答
下面是导致htaccess文件的内容。一位朋友帮助我...
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.css|\.js|index\.php)$
RewriteCond %{REQUEST_URI} !^/$
RewriteRule (.*) http://jugglegood.com/$1 [R=301,NC,L]