How can I disable the forced redirect to https previously selected?

Server version: Apache/2.4.53 (Rocky Linux)
Rocky Linux release 9.2 (Blue Onyx)

I am Japanese. This article is written through google translation. So the sentence may be a little unnatural.
I have a problem as the title says.
I changed the settings of httpd.conf etc., but it doesn't work.
Can anyone help me?

Hello @aaase24, welcome to the Let's Encrypt community. :slightly_smiling_face:

Here details on Apache can be found in documentation and forums:

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

Thank you for assisting us in helping YOU!

2 Likes

while I have no reason to believe so :
BTW if you are using cloudflare ssl setting it will redirect to https version from their edge on client

4 Likes

My domain is:basasaba.com

I ran this command:certbot
(After that, I followed the instructions.)

It produced this output:I got an output that I thought was successful.

My web server is (include version):Apache/2.4.53 (Rocky Linux)

The operating system my web server runs on is (include version):Rocky Linux release 9.2 (Blue Onyx)

My hosting provider, if applicable, is:SAKURA internet

I can login to a root shell on my machine (yes or no, or I don't know):yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):certbot 2.6.0

i don't use cloudflare

If Certbot was also used to add the redirect from HTTP to HTTPS, it will have added a few mod_rewrite directives to the Apache HTTP virtual host configuration file consisting of a RewriteEngine , RewriteCond and RewriteRule directive.

If you comment those lines out and reload Apache, the redirect would be disabled.

I'm not sure if Certbot is capable of undoing just the redirect itself.

2 Likes

Should I edit the configuration file /etc/httpd/conf/httpd.conf?

Usually the active VirtualHost definitions are in the /sites-enabled folder which are symlinks to a file in /sites-available

But, yes, if you have them in httpd.conf then update it there

https://docs.rockylinux.org/guides/web/apache-sites-enabled/

3 Likes

Not directly related to the HTTPS redirection...
I can't reach the HTTP site:

curl -Ii http://basasaba.com/
curl: (56) Recv failure: Connection reset by peer
3 Likes

where is the sites-available directory?

that'd debian/Ubuntu specifically, centos do things differently

3 Likes

What shows?:
sudo apachectl -t -D DUMP_VHOSTS

3 Likes

The Rocky Linux Docs I linked showed using sites-available and sites-enabled. Is that not how it's done on that system?

We will find out soon what method they used once they respond to @rg305 DUMP_VHOSTS command

3 Likes

It was output as below.

Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
To pass extra arguments to httpd, see the httpd.service(8)
man page.

Since it is still in the testing stage, the server is turned on only when the website is being built.

Also, the execution result of "sudo apachectl -t -D DUMP_VHOSTS" replacing apachectl with httpd is as follows.

VirtualHost configuration:
*:80 is a NameVirtualHost
default server basasaba.com (/etc/httpd/conf/httpd.conf:382)
port 80 name vhost basasaba.com (/etc/httpd/conf/httpd.conf:382)
alias www.basasaba.com
port 80 name vhost sample.basasaba.com (/etc/httpd/conf/httpd.conf:391)
*:443 is a NameVirtualHost
default server ik1-133-73216.vs.sakura.ne.jp (/etc/httpd/conf.d/ssl.conf:40)
port 443 name vhost ik1-133-73216.vs.sakura.ne.jp (/etc/httpd/conf.d/ssl.conf:40)
port 443 name vhost basasaba.com (/etc/httpd/conf/httpd-le-ssl.conf:2)
port 443 namevhost sample.basasaba.com (/etc/httpd/conf/httpd-le-ssl.conf:14)

1 Like

For which of those names do you want to disable the redirection?

3 Likes

they are all

Then we should have a look at those two vhost sections in the file:
/etc/httpd/conf/httpd.conf

2 Likes
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName basasaba.com
ServerAlias www.basasaba.com
RewriteEngine on
RewriteCond %{SERVER_NAME}=basasaba.com
RewriteRule ^ https://%{SERVER_NAME]%{REQUEST_URI} [END, NE, R=permanent]
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/sample
ServerName sample.basasaba.com
#ServerAlias sample.basasaba.com
RewriteEngine on
RewriteCond %{SERVER_NAME}=sample.basasaba.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END, NE, R=permanent]
</VirtualHost>