21 users online (0 members and 21 guests)  


  Results 1 to 10 of 10

Related

  1. Subdomain find in search but domain not?    Forum: Search Engine Optimization - SEO - Forum
    Replies: 2
  2. Subdomain Question    Forum: HTML Forum
    Replies: 2
  3. Replies: 1
  4. ftp problems    Forum: HTML Forum
    Replies: 6
  1. #1
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17

    subdomain problems

    I made a subdomain at the domain icasa. The subdomain is ovello. I set a redirectation of the subdomain www.ovello.icasa.ro, so a script is executed. Unfortunatelly I receive a lot of errors, the first one is:

    Warning: fopen(errors.csv): failed to open stream: Permission denied in /home/icasaro/public_html/config/config.php on line 38

    If you would visit the link www.ovello.icasa.ro you`ll see my problem. The error appear because I want to open a file and I suppose I am not allowed to open it. Another interesting thing is that the URL www.ovello.icasa.ro is changed with the redirectation (in my case: http://www.icasa.ro/agentii/16/ ). If you visit www.icasa.ro and navigate on the page, the page errors.csv is accessed but no error occures. How can I solve my problem?

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Well, check the obvious first. make sure you CHMOD your errors.csv file to 777 just to see if that works. If it does, make sure you reduce it to 755 and make sure it still works.

    Otherwise, thats a bit weird. The redirect shouldn't be making much difference, though it may be to do with the subdomain user being different to the owner of errors.csv

    Try the chmod. if that doesn't work please post the code so we can check that.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17
    I have already set the mode for errors.csv to 777, but the script still doesn`t work. I don`t know if I should insist on this problem, because I do not want the URL to be changed. So, I want to solve this problem first (changing of the URL from www.ovello.icasa.ro to http://www.icasa.ro/agentii/16/). Perhaps I didn`t create the subdomain correctly. I created it with Panel X and I added a redirectation to the subdomain. Maybe I`d rather delete the redirectation and append/link a subdirectory of the domain to the subdomain, but I don`t know to do that. What do you suggest?

    The code that tries to open the errors.csv is listed below:

    /*errors to file see 1&1*/
    ###error_reporting(0);
    $old_error_handler = set_error_handler("userErrorHandler");
    function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) {
    $time=date("d M Y H:i:s");
    // Get the error type from the error number
    $errortype = array (1 => "Error",
    2 => "Warning",
    4 => "Parsing Error",
    8 => "Notice",
    16 => "Core Error",
    32 => "Core Warning",
    64 => "Compile Error",
    128 => "Compile Warning",
    256 => "User Error",
    512 => "User Warning",
    1024 => "User Notice",
    2048 => "ultima");
    $errlevel=$errortype[$errno];

    //Write error to log file (CSV format)
    $errfile=fopen("errors.csv","a");
    fputs($errfile,"\"$time\",\"$filename: $linenum\",\"($errlevel) $errmsg\"\r\n");
    fclose($errfile);

    if($errno!=2 && $errno!=8 && $errno!=2048) {
    //Terminate script if fatal errror
    die("A fatal error has occured. Script execution has been aborted. errno=$errno");
    }
    }
    /*end errors to file*/

    PS: Do you know where I can find some documents for using subdomains?
    Last edited by ovello; 01-14-2005 at 02:57 AM.

  4. #4
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17
    Another question: How can I connect to the subdomain? I tried to connect to the subdomain, using the subdomain`s name instead domain`s name, but I cannot see the index.html file of the subdomain.

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Shouldn't it be

    Code:
     $errfile=fopen("../../errors.csv","a");
    As far as I can see, /agentii/16 does not contain errors.csv, so we need to use the above?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #6
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17
    No, I do not need to use everything (every function and all the code) of the domain. In fact I`m sure it will never work because sometimes I use relative path and sometimes I use absolute path... I do not have time to change all the code... That`s why I decided to write a new script especially designed for the subdomains even if, maybe, it will take me a lot of time.

    PS: Can you tell me where I can find useful documents about redirectations and subdomains?

  7. #7
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Theres not a lot to worry about with subdomains created thru cpanelX (I also have this cpanel)

    Points to remember:

    1) It creates the subdomain document root as a subfolder of the normal document root
    eg so if you create dean.icasa.ro then it will technically live in www.icasa.ro/dean

    2) A subdomain usually runs as a different web user.

    I'll be honest, I'm a little confused as to what your trying to achieve and why subdomains come into it. How about explaining it all from the beginning and maybe I'll be able to give ome useful advice?
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  8. #8
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17
    www.icasa.ro is a website for advertising the offers of selling or renting apartments or villas or houses and so on. There are a lot of Romanian organisations which rent or sell houses, apartments and so on. That`s why I have to create a subdomain for every organisation/agency registered on the site: www.organisation.icasa.ro .

    Now, my problems is that if I set a redirectation to the subdomain, the address in the browser is changed into www.icasa.ro/organisations/id_organisation/ All I want to do is to make the address unchangeable. So, if I write: www.ovello.icasa.ro in the address field of the browser it is changed into www.icasa.ro/agentii/16/ and I don`t want it to.

    Why I set the redirectation? Because I use a template for every organisation and I do not want to create a different website for every agency. I want to use the same scripts and the same templates for every organisation even if the organisations have their own (different) subdomains.

    I hope that everything`s clear now.

  9. #9
    ovello's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2004
    Posts
    17
    I think I solved the problem. Instead of using redirectation with CPanel X or php header function, I used require("http://www.icasa.ro/agentii/16/index.php"); and it works.

  10. #10
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Cool
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread