--- trunk/webwork2/lib/Apache/WeBWorK.pm 2003/01/09 19:03:54 699 +++ trunk/webwork2/lib/Apache/WeBWorK.pm 2003/02/26 17:58:16 746 @@ -35,15 +35,16 @@ # to your httpd.conf file to achieve this: # # -# PerlFreshRestart On -# -# SetHandler perl-script -# PerlSetVar webwork_root /opt/webwork -# -# use lib '/opt/webwork/lib'; -# -# PerlHandler Apache::WeBWorK -# +# PerlFreshRestart On +# +# SetHandler perl-script +# PerlHandler Apache::WeBWorK +# PerlSetVar webwork_root /path/to/webwork-modperl +# +# use lib '/path/to/webwork-modperl/lib'; +# use lib '/path/to/webwork-modperl/pglib'; +# +# # sub handler() { @@ -72,13 +73,6 @@ my $webwork_root = $r->dir_config('webwork_root'); # From a PerlSetVar in httpd.conf my $course = shift @components; - # If no course was specified, redirect to the URL specified by the constant WEBWORK_HOME - # (this is typically just "/".) - unless (defined $course) { - $r->header_out(Location => WEBWORK_HOME); - return REDIRECT; - } - # Try to get the course environment. my $course_env = eval {WeBWorK::CourseEnvironment->new($webwork_root, $urlRoot, $course);}; if ($@) { # If there was an error getting the requested course @@ -87,6 +81,13 @@ return DECLINED; } + # If no course was specified, redirect to the URL specified by the constant WEBWORK_HOME + # (this is typically just "/".) + unless (defined $course) { + $r->header_out(Location => $course_env->{webworkURLs}->{home}); + return REDIRECT; + } + # Freak out if the requested course doesn't exist. For now, this is just a # check to see if the course directory exists. if (!-e $course_env->{webworkDirs}->{courses} . "/$course") {