My apache has strange behavior where when accessing the folder without trailing slash it goes to https. For example http://domain.tld/foldername it will goes to https://domain.tld/foldername/ ...

I have no .htaccess on that webroot and I cannot find any mod_rewrite settings on httpd.conf and virtual host config.

Anyone could help and advise to shed me some lights?

Thanks. James


Look at server logs. It will help in determining whether redirection is sent by server or client is redirecting to HTTPS due to plugins like (HTTPS Everywhere). You can also use few other web browsers / machine to determine the same.

Since the reason is most likely going to be server configuration, grep for 'RewriteRule' or 'Redirect' in apache configuration directory using:

grep -r RewriteRule .

This would allow you to rephrase "I cannot find any mod_rewrite settings" to "there are no mod_rewrite settings" anywhere in configuration, which would be a big help.

  • Also, look inside the actual Apache config files in /etc/apache2/ *(using Ubuntu as an example) to see if there is a config file that is causing that to happen. – JakeGould Mar 7 '13 at 4:03
  • Thanks guys for your sharing and response. I found the problem in vhost config file. I have the line "SSLEngine On" which is duplicate from conf.d/ssl.conf that has already activated. After I disabled it, everything works correctly. James – James W. Mar 7 '13 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.