2016-11-13 64 views
1

我想通过保留地址栏中的现有网址实现重定向。我以某种方式实现它,但无论在哪个页面重定向我收到错误404。我有mod_proxy和proxy_http启用。这里是我的htaccess代码:错误404与mod_proxy和重定向

#Options +FollowSymLinks -MultiViews 
RewriteEngine On 
RewriteBase/
RewriteRule ^(.*) http://demo.example.com/$1 [P] 

任何想法?我的服务器是VPS使用Plesk,如果需要

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-042stab120.5 x86_64) 

* Documentation: https://help.ubuntu.com/ 
Last login: Fri Nov 11 19:59:21 2016 from adsl-152.176.58.250.tellas.gr 
[email protected]:~# curl -vv http://gazzetta.edentalbook.com 
* Rebuilt URL to: http://gazzetta.edentalbook.com/ 
* Hostname was NOT found in DNS cache 
* Trying 92.51.132.79... 
* Connected to gazzetta.edentalbook.com (92.51.132.79) port 80 (#0) 
> GET/HTTP/1.1 
> User-Agent: curl/7.35.0 
> Host: gazzetta.edentalbook.com 
> Accept: */* 
> 
< HTTP/1.1 404 Not Found 
< Date: Sun, 13 Nov 2016 20:59:19 GMT 
* Server Apache is not blacklisted 
< Server: Apache 
< Access-Control-Max-Age: 1000 
< Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding 
< Access-Control-Allow-Credentials: true 
< Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT 
< Expires: Thu, 19 Nov 1981 08:52:00 GMT 
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 
< Pragma: no-cache 
< Access-Control-Allow-Origin: http://demo.edentalbook.com 
< X-Powered-By: PleskLin 
< MS-Author-Via: DAV 
< Vary: Accept-Encoding 
< Content-Type: text/html; charset=UTF-8 
< Set-Cookie: PHPSESSID=62hctjah1g95c33lprkk2q9m50; expires=Sun, 20-Nov-2016 20:59:19 GMT; path=/; HttpOnly 
< X-Powered-By: PleskLin 
< Transfer-Encoding: chunked 
< 
+0

你可以尝试在你的网站上运行一个详细的'curl'请求并在这里粘贴你的问题?像这样:curl -vv <你的网站在这里> –

+0

@melgart我需要运行这个?在htaccess中?在PHP代码或终端? –

+0

对不起,在一个终端。这将显示一个更详细的请求到您的网站 –

回答

0

它看起来像HTTP标头“主机”的请求被传输,但不匹配服务器上我有机会获得任何的conf文件。

您可以通过reset this header

Header set Host "demo.edentalbook.com" 

或者添加域别名gazzetta.edentalbook.comdemo.edentalbook.com在那里举办。