【问题标题】:apache2 disable redirect to httpsapache2 禁用重定向到 https
【发布时间】:2021-09-18 17:14:13
【问题描述】:

当我从我的 drupal 网站注销时,我的子域将我返回到 https

我尝试禁用 ssl 并重新启动 apache2 但无法正常工作 我也尝试过修改 .htaccess 文件,但总是 KO

这只发生在这个子域中,所有其他域都可以正常工作 我的子域配置文件

<VirtualHost sub.domain.fr:80>
        ServerAdmin webmaster@mydomain.fr
        DocumentRoot /home/ubuntu/mydomain/public_html/app2.mydomain.fr
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory "/home/ubuntu/mydomain/public_html/app2.mydomain.fr">
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

apache2.conf 文件



DefaultRuntimeDir ${APACHE_RUN_DIR}

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On


MaxKeepAliveRequests 100


KeepAliveTimeout 5


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}


HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log


LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf


<Directory />
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        Require all granted
</Directory>


<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>



AccessFileName .htaccess


<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

Include sites-enabled/

ports.conf 文件

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80
Listen 8080

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>


【问题讨论】:

    标签: apache ssl redirect https


    【解决方案1】:

    首先,将您的虚拟主机配置更改为:

    <VirtualHost *:80>
        ServerName sub.domain.fr
    

    然后确保重定向不会仅仅因为您的浏览器缓存而发生:始终使用匿名窗口,或者更好的是,使用 curl 模拟导航,这样您就不会使用任何类型的缓存响应。

    【讨论】:

      猜你喜欢
      • 2016-01-26
      • 1970-01-01
      • 2018-02-10
      • 2017-03-14
      • 2017-07-14
      • 2016-12-09
      • 1970-01-01
      • 2019-10-26
      • 2020-04-16
      相关资源
      最近更新 更多