Jump to content

How to have different default pages in cpanel


vincent_g

Recommended Posts

You may want a different default page created for new accounts depending on the package.

 

Easy to do with cpanel hooks

 

Place your default page in the root cpanel3_skel folder

 

create a new file in scripts called postwwwacct

 

Add this code to it:

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

#!/usr/bin/perl

 

my %OPTS = @ARGV;

my $username = $OPTS{'user'};

my $package = $OPTS{'plan'};

 

$fname = "/home/" . $username . "/public_html/index.html";

 

$html_txt = "<HTML>Your html here</HTML>";

 

if ($package =~ /email-1/){

my $cmd = "echo \"$html_txt\" > $fname";

system($cmd);

}

 

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

 

In place email-1 place your package name for the different page you want for that package.

 

Since an email only account would not have a website you can put what ever you wish there.

 

After creating this file set it to 777 using chmod else it will not run

 

Now after an account is created it will copy the default page to the site and if the package matches your package where you want the page to be different then it will over write the page with the code you assigned to $html_txt

 

for email only accounts you can add a command to rename or move the ftp username file also so as to disable ftp

Link to comment
Share on other sites

That is what it does.

 

It's not something I am asking help for as I have fully tested it and it works.

 

It will place a page you want for a package you wish to have such a page.

 

With modifications you can lets say rename the FTP user so as to disable FTP

Or make other changes to the account type based on your package name

 

It will overwrite the default page if one is there or create one if none is there

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated