mod_proxy和重定向

时间:2016-11-13 20:42:46

标签: apache .htaccess httpd.conf plesk mod-proxy

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

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

有什么想法吗?我的服务器是带有plesk的vps,如果需要我可以访问任何conf文件

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
root@lvps92-51-132-79:~# 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
<

1 个答案:

答案 0 :(得分:0)

看起来请求中的HTTP标头“主机”已发送但在服务器上不匹配。

你可以reset this header通过:

Header set Host "demo.edentalbook.com" 

或将域别名gazzetta.edentalbook.com添加到其托管的域demo.edentalbook.com

相关问题