How do I redirect a website to local website?

Issue

This Content is from ServerFault. Question asked by Bret Joseph

I am trying to make my browser load local website instead of visiting actual website.

I have this httpd configuration

<VirtualHost 140.82.113.4:80>
    ServerName www.github.com
    ServerAlias github.com
    DocumentRoot /path/to/local/website
</VirtualHost>

<VirtualHost 140.82.113.4:443>
    ServerName www.github.com
    ServerAlias github.com
    DocumentRoot /path/to/local/website
    SSLCertificateFile /etc/pki/tls/certs/github.com.crt
    SSLCertificateKeyFile /etc/pki/tls/private/github.com.key
</VirtualHost>

When I type in the browser https://github.com, it still loads the real website. I want it to load the local files at /path/to/local/website/index.html not go to the realone. What do I need to configure



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from serverfault, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?