Disable Index - Moodle 2.2.3 (debian)

Disable Index - Moodle 2.2.3 (debian)

by Mason Phonsavanh -
Number of replies: 4

I upgraded Moodle 1.9 to 2.2.3 (debian).

When I go to http://moodle.mysite.com it shows:

Index of/

moodle/

othersites/

I can click on the moodle directory and go straight to moodle.

or I can enter http://moodle.mysite.com/moodle

How do I disable indexing and go straight to moodle when I enter http://moodle.mysite.com?

Average of ratings: -
In reply to Mason Phonsavanh

Re: Disable Index - Moodle 2.2.3 (debian)

by Mason Phonsavanh -

I am able to fix this by bringing the files of the moodle directory up one level (cp -p /var/www/moodle/* /var/www).

I'd prefer it if I could change a config to point to /var/www/moodle instead.

In reply to Mason Phonsavanh

Re: Disable Index - Moodle 2.2.3 (debian)

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like document root as defined by apache config file is /var/www/ and that in the apache config, directory indexing is on ... which one could turn off.

Options Includes Indexes FollowSymLinks MultiViews

Using a text editor, remove the 'Indexes' and restart apache.

/etc/init.d/apache restart

Might consider creating an auto-forwarding default page (index.html - or however you've defined 'default pages') that forwards to the moodle directory.

http://www.webmastertechniques.com/Insight/redirect.html

https://httpd.apache.org/docs/current/mod/core.html

'spirit of sharing', Ken

In reply to Ken Task

Re: Disable Index - Moodle 2.2.3 (debian)

by Mason Phonsavanh -

I removed the "Indexes" prior and restarted apache but that did not diable indexing.

 

Thanks for the advice and links.

In reply to Mason Phonsavanh

Re: Disable Index - Moodle 2.2.3 (debian)

by Bret Miller -

You can do that in a number of ways by redirecting or rewriting the root directory to the /moodle subdirectory using .htaccess or any number of different methods. For a simple redirect you could create index.php in the root directory of your site with just this line in it:

header('Location: /moodle/');