dealing with symlinks

dealing with symlinks

by Sebastien Jaffredo -
Number of replies: 2

I've adopted the solution of a symlink in every course folder pointing to a common_files directory within the data directory. We even added some code sothat moodle creates that link automatically with every new course.

It works fine for one file, but the links within the  file won't work.

For example, if I have an "a.html" page in the common_files directory with a link in it pointing to a "b.html" file next to it (href="b.html"), and if I add a.html as a resource in course 2, a.html is being called alright, but the link to b.html won't work. (it'll appear in the browser as "sitename/file.php/2/common_files/b.html").

Most of my content is based on combined html files I'm reusing in many courses, so I badly need to have the whole thing work.

Can anyone help out on this one? Thanks a lot

 

Attachment symlink.PNG
Average of ratings: -
In reply to Sebastien Jaffredo

Re: dealing with symlinks

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If this works:

   http://example.com
/file.php/2/common_files/a.html

then the relative link "b.html" should cause the browser to look for

  
http://example.com/file.php/2/common_files/b.html

which should also just work, shouldn't it?

In reply to Martin Dougiamas

Re: dealing with symlinks

by Sebastien Jaffredo -

Actually, it's working now with this simple example I made as a test. There might have been a problem with my server.

Now, when I do the same test with the resource I want to use (an html file with embedded .swf files), it works fine within the course file directory but not within the common_files directory.