【发布时间】:2017-03-27 11:47:27
【问题描述】:
我试图通过在地址栏中保留现有 url 来实现重定向。我以某种方式实现了它,但无论我在哪个页面重定向我都会收到错误 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
<
【问题讨论】:
-
您能否尝试对您的网站运行详细的“curl”请求并将输出与您的问题一起粘贴到此处?像这样: curl -vv
-
@melgart 我需要在哪里运行它?在htaccess里面?在 php 代码中还是在终端中?
-
抱歉,在终端中。这将向您的网站显示更详细的请求
-
@melgart 刚刚编辑
标签: apache .htaccess httpd.conf plesk mod-proxy