# Redirection not working anymore and odd behavior

**URL:** https://community.letsencrypt.org/t/redirection-not-working-anymore-and-odd-behavior/10375
**Category:** Server
**Created:** [February 6, 2016, 7:22pm UTC](https://community.letsencrypt.org/t/redirection-not-working-anymore-and-odd-behavior/10375 "2016-02-06T19:22:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hoaphumanoid](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/hoaphumanoid/32/4987_2.png) [@hoaphumanoid](https://community.letsencrypt.org/u/hoaphumanoid)
#### Post date: [February 6, 2016, 7:22pm UTC](https://community.letsencrypt.org/t/redirection-not-working-anymore-and-odd-behavior/10375/1 "2016-02-06T19:22:14Z")

</div>

I just installed let’s encrypt in my blog that runs on apache. I had before a redirection from http:// www. [miguelgfierro.com](http://miguelgfierro.com) to http:// [miguelgfierro.com](http://miguelgfierro.com). I used Redirect to do it and it worked well. However, when I installed let’s encrypt now suddenly I have the both links redirect to https:// www. [miguelgfierro.com](http://miguelgfierro.com) and I don’t know why.

My current configuration is the following:

```
<VirtualHost *:443>        
ServerName www.miguelgfierro.com
ServerAlias miguelgfierro.com
DocumentRoot /var/www/sciblog 
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/www.miguelgfierro.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.miguelgfierro.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.miguelgfierro.com/chain.pem
</VirtualHost>

```

I don’t have a configuration with VirtualHost: \*80 right now because it’s not affecting the server at all, so I erased it.

I would like to redirect everything (http://, http:// www, https:// and https:// www.) to [https://miguelgfierro.com](https://miguelgfierro.com). I tried to use Rewrite and Redirect but none of them work. Any help is appreciated

---

<div class="post-metadata">

### Author: ![sahsanu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/sahsanu/32/89984_2.png) [@sahsanu](https://community.letsencrypt.org/u/sahsanu)
#### Post date: [February 6, 2016, 8:57pm UTC](https://community.letsencrypt.org/t/redirection-not-working-anymore-and-odd-behavior/10375/2 "2016-02-06T20:57:15Z")

</div>

Hello @hoaphumanoid,

Hope this helps:

```
<VirtualHost *:80>
ServerName miguelgfierro.com
ServerAlias www.miguelgfierro.com
Redirect permanent / https://miguelgfierro.com/
</VirtualHost>

<VirtualHost *:443>
ServerName www.miguelgfierro.com
Redirect permanent / https://miguelgfierro.com/
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/www.miguelgfierro.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.miguelgfierro.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.miguelgfierro.com/chain.pem
</VirtualHost>

<VirtualHost *:443>
ServerName miguelgfierro.com
DocumentRoot /var/www/sciblog
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/www.miguelgfierro.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.miguelgfierro.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.miguelgfierro.com/chain.pem
</VirtualHost>

```

Cheers,  
sahsanu

---

<div class="post-metadata">

### Author: ![hoaphumanoid](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/hoaphumanoid/32/4987_2.png) [@hoaphumanoid](https://community.letsencrypt.org/u/hoaphumanoid)
#### Post date: [February 7, 2016, 8:48am UTC](https://community.letsencrypt.org/t/redirection-not-working-anymore-and-odd-behavior/10375/3 "2016-02-07T08:48:33Z")

</div>

Thank you friend, it worked perfectly!
