0

Finally I have finished install SSL Certificate and finish to config the redirect from my old site to my new one, but right now when I try to entering from the old site, it send to me to new sit but withouth "/" like:

https://newsite.comindex.php?blabla

This is my httpd.conf configuration:

<VirtualHost oldsite.com:80>
        ServerName oldsite.com
        Redirect permanent "/" https://newsite.com/
</VirtualHost>
<VirtualHost oldsite:443>
        ServerName oldsite.com
        Redirect permanent "/" https://newsite.com/
</VirtualHost>
<VirtualHost *:80>
        ServerName https://newsite.com
        Redirect permanent "/" https://newsite.com/
</VirtualHost>

I really appreciate any help you can provide.

digijay
  • 1,155
  • 3
  • 11
  • 22

1 Answers1

0

Try it like this:

<VirtualHost *:80>
        ServerName oldsite.com
        Redirect permanent / https://newsite.com/
</VirtualHost>
<VirtualHost *:443>
        ServerName oldsite.com
        Redirect permanent / https://newsite.com/
        SSLEngine On
        SSLCertificateFile oldcert…
        SSLCertificateKeyFile oldkey…
</VirtualHost>
<VirtualHost *:443>
        ServerName https://newsite.com
        Redirect permanent / https://newsite.com/
        SSLEngine On
        SSLCertificateFile newcert…
        SSLCertificateKeyFile newkey…

        <Directory /var/www/html/mysite/>

        </Directory>
</VirtualHost>

NameVirtualHosts should not be used anymore. Take care that you have a trailing slash in your Directory directive.

digijay
  • 1,155
  • 3
  • 11
  • 22