indexhtml to indexphp error

indexhtml to indexphp error

by Dan Nye -
Number of replies: 5

Greetings.  When I use my indexhtml as my moodle front page and then (via a button) go to my indexphp (moodle) I login and it takes me back to my indexhtml page... a vicious cycle.

I'm using 1.9. 

Thanks in advance for you help!  Dan

Average of ratings: -
In reply to Dan Nye

Re: indexhtml to indexphp error

by Guillermo Madero -

A bit more info would be helpful... smile

In reply to Guillermo Madero

Re: indexhtml to indexphp error

by Dan Nye -

I want to use a regular html page as my first page.  Using a button from my first page, I would like the visitor to be able to go to the moodle front page.  I can get the front page to open the moodle front page, however after I login, it redirects me back to my html first page.

In reply to Dan Nye

Re: indexhtml to indexphp error

by Lao Shan -

By default, always prevails .html before .php

Perhaps the code can be changed, but my simple solution:

There is an option in Administration (Sorry I use the Spanish version):mymoodleredirect

With this option you force users to login to  yourmoodle.com/my

Best Regards.

In reply to Dan Nye

Re: indexhtml to indexphp error

by Ken Task -
Picture of Particularly helpful Moodlers

Defined in apache conf, index.html is servered first, then index.php.

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the   
# same purpose, but it is much slower.
#     
DirectoryIndex index.html

Evidently, the login to Moodle re-directs to / after logging on which is why you get infinite loop.

Suggest, to make this work, without having to do tweaking/hacking, etc. to anything, moodle be moved to a folder of it's own rather than being scattered over web root.  So at the web root (as an example on a CentOS server: webroot = /var/www/html/) there would be only an index.html page and the moodle folder.

This also gives one an advantage in installing other apps in their respective folders which could be interfaced with Moodle ... as examples, Mahara or Joomla with JFusion or a Word Press blog.

Others might offer a different (more complicated?) approach ... me, I like 'simple' and 'standard'! ;)

'spirit of sharing', Ken

In reply to Dan Nye

Re: indexhtml to indexphp error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hmm.. I'm not sure you're getting very good advice here. By *default* (i.e. if you installed Apache from source and used the supplied httpd.conf) the web server does not handle PHP files (and hence index.php) AT ALL. So, this really comes down to....

1. How did you set up Apache to serve PHP and what does your DirectoryIndex setting look like? It's normal to have something like "DirectoryIndex index.php index.html" - i.e. PHP first in an environment that primarily serves PHP files but it's rarely critical.

2. What does the link on your HTML page actually look like? Does it end up with '..../index.php'? If it doesn't, I suggest you make sure it does.

3. If that still doesn't fix it then you have some weird rewrites or redirects in your Apache config (or by extension a .htaccess file) which you will need to track down and fix.

Also, as Ken says, don't *ever* mix up different applications in the same directories if that's what you did. Learn about virtual directories etc. in the web server.