General help

 
 
Pietro
About 404 — File not found (how to solve?)
 
Hi to everybody

I REALLY need to solve this problem. This is driving me mad!

I just have made a clean installation in my remote server of the 1.9.9 version of Moodle. Everything is working fine except of one thing:

I have created a course (a simple course).
Every time I click on Administration > Files (to browse the course files or upload something), Moodle returns me a blank screen with the following message:

404 — File not found

This have to do with the place of folder moodledata for example?
Or something like that?

Someone can help me?

Best regards from Brazil!

 
Average of ratings: -
Picture of Howard Miller
Re: About 404 — File not found (how to solve?)
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
It's not Moodle returning that message it's the web server saying it can't find the file you are looking for. In particular, this probably means the Moodle *program* file.

Firstly, the URL when you get the error should look something like..

http://your.web.site/moodle/files/index.php?id=3

You should start by checking in your Moodle install that you have a directory called 'files' and that it has a file called 'index.php' in it. I suspect you will find that you don't, in which case something went wrong installing the Moodle files.

Failing that, you should check the file permissions (to ensure the web server can read them) and check for any conflicting web server configuration (don't forget to check any .htaccess files if you have any)
 
Average of ratings: -
Pietro
Re: About 404 — File not found (how to solve?)
 
Going to "files" folder, I have found the index.php file.
Should I do something with it?

I have a Wordpress 3.0 installation in this same server. I forgot to say that.
Moodle is inside it.

Just for a example:
Wordpress is in /www and Moodle is at /www/moodle

Is there a conflict between them?



Curiously, just for mention; I have another Moodle installation in another server and everything works great (with Wordpress like the case above). I can browse and upload any file at will.
 
Average of ratings: -
Pietro
Re: About 404 — File not found (how to solve?)
 
I think I've figured out what's happening:

Here is my .htaccess file on my webserver that upload works fine in Moodle:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


And here is my .htaccess where the problem happens:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]



I have installed Wordpress with MU (multiple sites feature) and I think that is causing the problem. When I reverted for the first .htaccess, everything works fine.

But how to make coexistence of the two then?
 
Average of ratings: -
Picture of Howard Miller
Re: About 404 — File not found (how to solve?)
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Don't... my advice would be to never do things like that.

It's (should be) simple enough to make your default directory point to the Wordpress directory and then have an alias for /moodle that points to somewhere else.

Failing that, you are probably going to have to provide Moodle with an htaccess file to override all the Wordpress settings. I'm not sure I would recommend that (or know how to do it even)
 
Average of ratings: -
Pietro
Re: About 404 — File not found (how to solve?)
 
Perhaps, I must create a condition in the .htaccess file that prevents Moodle from lose itself of finding the files of the course.

Some idea?

PS: I'm refering to this file:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]


 
Average of ratings: -
Picture of James Stanforth
Re: About 404 — File not found (how to solve?)
 

NB: this only seems necessary for Moodle 1.9 as Moodle 2+ seems to work fine in a subdirectory of a Wordpress installation without the need to change the htaccess file...

For Moodle 1.9, you need to add the following line before the rewrite rule. 

RewriteCond %{REQUEST_URI} !.*YOUR MOODLE DIRECTORY/files.*

So you end up with an htaccess file that looks something like this (change YOURMOODLEDIRECTORY to the subdirectory containing your Moodle installation):

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteCond %{REQUEST_URI} !.*YOUR MOODLE DIRECTORY/files.*
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
 
Average of ratings: -
Picture of Muhammad Talut
How to embed youtube video links in folders?
 

I want to embed video links in a folder. I just want it to open upon clicking on it in the moodle page like facebook does. How can do so? Somebody please help me out. 

 
Average of ratings: -
Gmads
Re: How to embed youtube video links in folders?
Group Particularly helpful MoodlersGroup Testers

Duplicate post, ignore it... see here:

https://moodle.org/mod/forum/discuss.php?d=241337

 
Average of ratings: -