Pages

Wednesday, January 14, 2015

Website redirect / webpage redirect by html page and servers virtualhost




### We can do this by two way...
1) By adding a index.html page to the site for redirect to another site
2) By Adding some code in web-servers VirtualHost at httpd.conf file

we want to redirect www.example.com page to www.tayabkhan.info
Goto example.coms index.html file and code those

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=http://www.tayabkhan.info/">
        <script type="text/javascript">
            window.location.href = "http://www.tayabkhan.info/"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow the <a href='http://www.tayabkhan.info/'>link to ABCXYZ</a>
    </body>
</html>


--------------------------------------

<VirtualHost serverip:80>
ServerAlias example.com
ServerAlias www.example.com
Redirect permanent / http://www.tayabkhan.info/
</VirtualHost>


----------------------------------------------------------
-------------------------------Enjoy This-----------------
----------------------------------------------------------


No comments:

Post a Comment