Search code examples
http-redirectdnsa-records

Redirect page URL to specific IP address


Say I have two servers, each with its own website, that share a domain name (www.sitename.com). As far as I know, you can only point the domain name to one of the servers.

Is it possible to point individual page url's (www.sitename.com/page) to either server through htaccess, DNS records, or otherwise?

Thanks for any input.


Solution

  • I have achieved this via .htaccess file, in which i redirected my website to IP address and then to sub-domain, use can make use of the same.

    RewriteEngine on
    
    RewriteOptions inherit
    
    RewriteCond %{HTTP_HOST} ^hardworkerz\.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.hardworkerz\.net$
    RewriteRule ^/?$ "https\:\/\/103\.7\.129\.132\/CorporateUI" [R=301,L]
    

    In this redirection code i have redirected my website hardworkerz.net and www.hardworkerz.net to IP address 103.7.129.132 and further to subdomain CorporateUI permanently.