求求各位男神女神帮帮我!! apache 多次跳转的。。

2014-08-20 17:35:53 +08:00
 lovelinghan
吃饱了撑的搞这个
昨晚突然脑残了想玩https
从http跳到https 在跳另一个到https
http>>>>https>>>>htpps
从此节操是路人啊!!!
apache各种报错...
好不容易没报错,然后然后所有的电脑都访问不了!!!!!!只能通过手机平板等移动设备访问。。
Chrome提示是 网址为 XXXX 的网页可能暂时无法连接,或者它已永久性地移动到了新网址。
Apache的配置

<VirtualHost *:80>
ServerName hi.XXX.com
DocumentRoot /var/www/123
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/apache2/conf-available/error.conf
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</VirtualHost>
#--------------------SSL-------------------------
<VirtualHost *:443>
ServerName hi.xxx.com
DocumentRoot /var/www/123
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/hi-cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/hi-key.pem

Include /etc/apache2/conf-available/error.conf
</VirtualHost>
html跳转的代码
<body>
<script type="text/javasctipt">window.navigate('https://XX.com/cgi-bin/fm.html');</script>
</body>
跪谢!!!!
2335 次点击
所在节点    问与答
6 条回复
lovelinghan
2014-08-20 20:38:10 +08:00
没有人可以帮我吗
pinger
2014-08-20 22:28:03 +08:00
我觉得吧,只能手机平板访问是因为你用了window.navigate,这个只对IE有作用的大概,但我猜你电脑肯定不是用IE。。。
lovelinghan
2014-08-20 22:30:07 +08:00
@pinger 不加SSL能正常访问
pinger
2014-08-20 23:07:37 +08:00
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]是不是少了个‘/’?改为RewriteRule ^.*$ https://%{SERVER_NAME}/%{REQUEST_URI} [L,R]试试
pinger
2014-08-20 23:14:32 +08:00
我没怎么看懂你的描述,“http跳到https 在跳另一个到https啊”什么意思?你是不是只想访问http://hi.xxx.com自动跳转到https://hi.xxx.com,而其他所有域名都是http访问啊?
lovelinghan
2014-08-21 14:58:35 +08:00
@pinger 我特别爱作死
http>>https
https 的index 进行一个URL转发到另外一个https网站去
谢谢你

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/128992

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX