Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 合并站点和重定向旧URL_.htaccess_Mod Rewrite_Url Redirection - Fatal编程技术网

.htaccess 合并站点和重定向旧URL

.htaccess 合并站点和重定向旧URL,.htaccess,mod-rewrite,url-redirection,.htaccess,Mod Rewrite,Url Redirection,我们已经合并了2个站点,必须从现在未使用的域组织重定向 域aquarestaurantblackheath.co.uk重定向良好,但不重定向来自该域的旧URL 任何建议。查看我的代码 工作 RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR] RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$ RewriteRule ^/?$ "http\:

我们已经合并了2个站点,必须从现在未使用的域组织重定向

域aquarestaurantblackheath.co.uk重定向良好,但不重定向来自该域的旧URL

任何建议。查看我的代码

工作

RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$
RewriteRule ^/?$  "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/3\/1\/restaurant\-blackheath" [R=301,L]
不起作用

RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$
RewriteRule ^section\/8\/1\/location$ "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/10\/1\/restaurant" [R=301,L]

RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$
RewriteRule ^section\/6\/1\/wines$ "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/8\/1\/food\-wine\-blackheath" [R=301,L]

RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$
RewriteRule ^section\/7\/1\/reservations$ "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/3\/1\/restaurant\-blackheath" [R=301,L]

整个HTC访问:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^aquabarandgrill.co.uk [NC] 
RewriteRule ^(.*)$ http://www.aquabarandgrill.co.uk/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ http://www.aquabarandgrill.co.uk/ [R=301,L] 
RewriteRule ^index\.html$ http://www.aquabarandgrill.co.uk/ [R=301,L] 
RewriteRule ^index\.htm$ http://www.aquabarandgrill.co.uk/ [R=301,L] 

RewriteEngine on
Options +SymlinksIfOwnerMatch +MultiViews
RewriteRule ^(.*).php/(.*) $1.php?$2

## Bromley old site REDIRECTS (PERMANANT 301) ##

RewriteRule ^Home.php?id=Menus/?$ http://www.aquabarandgrill.co.uk/section/2/1/restaurant-bromley/ [L,R=301,NC]

#
## Deafult character encoding UTF-8 / ISO-8859-1
AddDefaultCharset ISO-8859-1

RewriteEngine On

RewriteCond %{HTTP_HOST} ^aquarestaurantblackheath\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquarestaurantblackheath\.co\.uk$
RewriteRule ^/?$ "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/3\/1\/restaurant\-blackheath" [R=301,L]

RewriteCond %{HTTP_HOST} ^aquabrasseriecroydon\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.aquabrasseriecroydon\.com$
RewriteRule ^/?$ "http\:\/\/www\.aquabarandgrill\.co\.uk\/section\/4\/1\/restaurant\-croydon" [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^(/?|section/7/1/reservations)$ http://www.aquabarandgrill.co.uk/section/3/1/restaurant-blackheath [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC] 
RewriteRule ^section\/8\/1\/location$ http://www.aquabarandgrill.co.uk/section/10/1/restaurant [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^section\/6\/1\/wines$ http://www.aquabarandgrill.co.uk/section/8/1/food-wine-blackheath [R=301,L]
请尝试以下规则:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^(/?|section/7/1/reservations)$  http://www.aquabarandgrill.co.uk/section/3/1/restaurant-blackheath [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]    
RewriteRule ^section/8/1/location$ http://www.aquabarandgrill.co.uk/section/10/1/restaurant [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^section/6/1/wines$ http://www.aquabarandgrill.co.uk/section/8/1/food-wine-blackheath [R=301,L]


编辑 查看整个htaccess文件后,删除其中的所有内容,并用以下代码替换整个文件:

AddDefaultCharset ISO-8859-1
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^(/?|section/7/1/reservations)$  http://www.aquabarandgrill.co.uk/section/3/1/restaurant-blackheath [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]    
RewriteRule ^section/8/1/location$ http://www.aquabarandgrill.co.uk/section/10/1/restaurant [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?aquarestaurantblackheath\.co\.uk [NC]
RewriteRule ^section/6/1/wines$ http://www.aquabarandgrill.co.uk/section/8/1/food-wine-blackheath [R=301,L]

RewriteRule ^(.*)\.php/(.*) $1.php?$2 [L]

谢谢,域重定向可以正常工作,但URL不能。@Puzzel您能提供apache日志中的一些最新行吗?这里是[Thu Sep 24 23:56:00 2015][error][client 80.26.82.82]文件不存在:/home/bvistaftppass/public_html/templates/aqua panels/images/icon_element_next.png,referer:[Thu Sep 24 23:56:00 2015][错误][client 80.26.82.82]文件不存在:/home/bvistaftppass/public_html/templates/aqua panels/templatesource/menus/superfish/css/superfish-navbar-selective.css,referer:似乎您还有其他一些重写规则干扰重定向。@anubhava您能看看这个吗?