how to create url home page - not url/moodle?

how to create url home page - not url/moodle?

Michelle Monroe -
回帖数:6
I am using Moodle 1.9. I've created my learning site, but it is only accessible through my website using the Moodle directory. Example: www.example.com/moodle.

How do I create a homepage that will use my full url, then members can click through to the Moodle part? Is there a way to use Moodle as a template, so I don't have to create this homepage from scratch?

Thanks!
回复Michelle Monroe

Re: how to create url home page - not url/moodle?

Jez H -
Not quite sure what you want.

1) If you want moodle to be at "yourDomain.com" as opposed to "yourDomain.com/moodle" you can either:

1a) Move moodle up one level in your directory structure, so move it up from public_html/moodle to public_html

1b) Alter the config of your webserver to point the domain one folder down, i.e. tell Apache (or IIS) to look for yourDomain.com in public_html/moodle, as opposed to public_html

2) If all you want to do is create a homepage, then just dump that in public_html, though, to be honest if all you are running is Moodle you would be better off (IMO) putting Moodle up top.

I have used "public_html" as an example as it is common on many hosts... it may be WWW, web or something completely different in your case... what I can say is that it will be the directory above "moodle" 大笑


回复Michelle Monroe

Re: how to create url home page - not url/moodle?

Dave Brown -
I'm trying to do something similar. I got Moodle installed in a directory "public_html/moodle" and set up the first course there. Now I would like to move that course to "public_html/coursename" and have all of the links show up as "http://coursename/..." so that students are not confused by seeing "moodle" in the middle of things. I am using an "addon domain" that is essentially "coursename.com" which is currently linked to public_html/moodle; this allows students to access the frontpage by browsing to "coursename.com" however after the frontpage every address is seen as "baseaccount.com/moodle/..." which is tolerable but not as clean as I would like.

I tried renaming the "moodle" directory to "coursename" but that causes a warning and fatal error in the "require_once" function. It looks like the script cannot find the file "config.php" however, my FTP program shows that that file exists in the "coursename" subdirectory (the old "moodle" directory). I would have expected that all file and directory names would be home directory relative and, in fact the missing file name in the error message does show a "coursename" relative address for the "config.php" that cannot be found.

Is this the same problem?
回复Dave Brown

Re: how to create url home page - not url/moodle?

John Ryan -
Dave,

You will need to edit the config.php file to update the change of directory name.

Note that links will then be referenced as http://<your domain>/coursename/.. not as you said in your post.
回复John Ryan

Re: how to create url home page - not url/moodle?

Dave Brown -

That does it close enough - in fact is better.

Downloaded and edited config.php in Dreamweaver.

Looks good so far.

Thanks John.
回复John Ryan

Re: how to create url home page - not url/moodle?

Dave Brown -
Um - okay, I may have caused a different problem. I edited the config.php file and changed all of the root references to my new sub-domain. That seems to give me access that I need with nice looking links, however, accessing the help function (via the yellow question mark) doesn't find the database. Do I need to change the "dbname" and "dbuser" parameters as well? What about "dbpass"? If so, to what do I change them?
回复Dave Brown

Re: how to create url home page - not url/moodle?

Jim Johnson -

The way we set up our moodle site is http://subdomain.domain.com/portal/

Mainly so I could keep the root publichtml directory open for any changes without sorting through the moodle directories to find what I needed.  It also allows for ease of use when we take down our moodle site for maintenance. 

In our root publichtml directory I added this index.php

 <?php

$URL="http://subdomain.domain.com/portal/";

header ("Location: $URL");

?>

 It's a fairly simple fix and it doesn't confuse many people.