The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Allowing users to "switch off" their site

Discussion in 'General Discussion' started by peasepud, Dec 30, 2008.

  1. peasepud

    peasepud Registered

    Joined:
    Sep 15, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I run a number of sites for different clients and am developing a Content Management system to centralise the update of these sites. One of the suggestions made would be the ability to allow users to turn their site off and stop it from being viewed.

    Obviously I could do this via a php script on each site checking the flag to ensure the site is still to be shown before redirecting the page if not but would prefer not to have to do that if possible.

    Is there anyway I can use a script to set a redirect up or park a domain and undirect/ unpark on demand?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can call API1 functions from the XML API as described at: http://www.cpanel.net/plugins/xmlapi/cpanel.html . API1 has functions to park/unpark a domain and you can build a PHP script to utilize the XML API.

    The raw API1 call for parking a domain is:

    Code:
    <cpanel Park="park(example.com)">
    Where example.com is the domain to park.

    To unpark a domain, the API1 call is:

    Code:
    <cpanel Park="unpark(example.com)">
    For doing a redirect domain, the API1 call is:

    Code:
    <cpanel Park="setredirecturl(example.com,toURL)">
    Where example.com is the domain being redirected and toURL being the full URL to redirect to.
     
Loading...

Share This Page