Redirect from to is instead going to

I am using LetsEncrypt to add SSL certs to all my domains. I used the “force redirect to https” option when I set up the cert, which added the redirect to my *:80 virtualhost and created a *:443 virtualhost with the correct config. However, it’s behaving really strangely.

If you go to, it 301 redirects you to Nowhere in my config do I see a reason for that to happen, and I can’t figure out how to view the level of logs that would help me debug the issue.

Here are my conf files:

<VirtualHost *:80>

    RewriteEngine on
    RewriteCond %{SERVER_NAME}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerAdmin webmaster@localhost

	DocumentRoot /var/www/
	ErrorLog /var/www/
	CustomLog /var/www/ combined

  <Directory /var/www/>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
SSLCertificateFile /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
Include /etc/letsencrypt/options-ssl-apache.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Any help would be appreciated. Thanks!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I’m seeing something entirely different on my end, though neither redirect to anything when I access them.

When I visit, I see one site with two posts. It doesn’t redirect to www.

When I visit, I see an entirely different website.

When checking the IP they resolve to, they both resolve to the same IP address, so the issue here is configuration. Are there any other configuration files that you can provide? Something is separating the two and pointing to two entirely different directories from what I’m seeing on my end.

Hi @ryangiglio Looking at those two configurations, should never result in 301 to Are you sure there might not be hiding a configuration somewhere else? Or maybe your .htaccess has some redirects? Try running this to list all the VirtualHosts: sudo apache2ctl -S