V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
lovelinghan
V2EX  ›  问与答

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

  •  
  •   lovelinghan · 2014-08-20 17:35:53 +08:00 · 2327 次点击
    这是一个创建于 3562 天前的主题,其中的信息可能已经有所发展或是发生改变。
    吃饱了撑的搞这个
    昨晚突然脑残了想玩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>
    跪谢!!!!
    6 条回复    2014-08-21 14:58:35 +08:00
    lovelinghan
        1
    lovelinghan  
    OP
       2014-08-20 20:38:10 +08:00
    没有人可以帮我吗
    pinger
        2
    pinger  
       2014-08-20 22:28:03 +08:00   ❤️ 1
    我觉得吧,只能手机平板访问是因为你用了window.navigate,这个只对IE有作用的大概,但我猜你电脑肯定不是用IE。。。
    lovelinghan
        3
    lovelinghan  
    OP
       2014-08-20 22:30:07 +08:00
    @pinger 不加SSL能正常访问
    pinger
        4
    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
        5
    pinger  
       2014-08-20 23:14:32 +08:00
    我没怎么看懂你的描述,“http跳到https 在跳另一个到https啊”什么意思?你是不是只想访问http://hi.xxx.com自动跳转到https://hi.xxx.com,而其他所有域名都是http访问啊?
    lovelinghan
        6
    lovelinghan  
    OP
       2014-08-21 14:58:35 +08:00
    @pinger 我特别爱作死
    http>>https
    https 的index 进行一个URL转发到另外一个https网站去
    谢谢你
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1860 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:33 · PVG 00:33 · LAX 09:33 · JFK 12:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.