Re: Website preview script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 Mar 2012, at 03:06, Nibin V M wrote:

> But what my requirement here is, I need to display the website configured
> on our server. No matter where the domain actually points to :)
> 
> Perhaps it can call a proxy....here is the actual intention of creating
> this script.
> 
> Suppose X created a new website on serverA, but the domain actually
> pointing to ServerB. So to test his new website on ServerA, he either has
> to edit "hosts" file or use serverA/~user. I don't want him not to use
> either method. I would like to provide him a PHP feature on my control
> panel says "site preview" through which he can view his website on serverA.
> Its just like a website preview option in plesk control panel :)


I think you're looking at this problem from completely the wrong angle. Why does the preview need to sit under their domain name? If that's really what you want then you have no option but to do something very very clunky with their hosts file, or take over their DNS lookup which is just pure evil and will have huge side effects and security implications.

Why can't you simply set the virtual host for their site so it responds to two domain names. Firstly their actual domain name, and secondly something like theirdomain.com.preview.techsware.in (this would be *.preview.techsware.in in your zone file). That way they just need to visit http://theirdomain.com.preview.techsware.in/ and they'll see their website.

Simples.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux