Apache 2.2.3, DISABLE redirect port 80 to 443

19,185

Yes, you can remove RewriteRule for https and this prevent redirect from http to https. As well, you could remove whole .htaccess, it doesn't contain anything except rewriting to https.

Share:
19,185

Related videos on Youtube

NiteSup
Author by

NiteSup

Updated on September 18, 2022

Comments

  • NiteSup
    NiteSup over 1 year

    Sorry if I'm not clear, I'm newbie...

    We have a server Apache 2.2.3 on RHEL. In the httpd.conf there is no VirtualHost configuration, And the iptables service is stopped

    Based on this, https://wiki.apache.org/httpd/RedirectSSL I added in the httpd.conf file:

    NameVirtualHost *:80
    <VirtualHost *:80>
    
        ServerName mysite.address.com
    
    </VirtualHost>
    

    But when I try to access http://mysite.address.com I still get https://mysite.address.com

    (Thanks Simon Greenwood) There is a .htaccess with this

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    

    It seems for me that

    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    

    redirect all to https Isn't it?

    If yes, is it enouth to comment this line to stop the redirect?

    Thanks

  • Sami
    Sami over 3 years
    Where is https rule, I want to remove it, but can find no where. I could only see this line in .htaccess RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I removed and it makes no difference
  • Alexander Tolkachev
    Alexander Tolkachev about 3 years
    @Sami you should read how 301 redirect works.