Static Pages
Maintained by
Alexander Bias, Moodle an Hochschulen e.V.
Moodle plugin which displays static information pages which exist outside any course, imprint or faq pages for example, complete with Moodle navigation and theme
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
you have two possibilities to access a static page:
1. Via the "normal link", e.g. http://www.yourmoodle.com/local/staticpage/view.php?page=imprint
2. Via a mod_rewrite link, e.g. http://www.yourmoodle.com/static/imprint.html
As the normal link is working for you, there should be no fundamental problem with local_staticpage.
In addition to the normal link, you can establish a mod_rewrite rule as you did. Could you please tell me the URL you are using to call the static page and which doesn't work?
As soon as you check the checkbox of the "Force Apache mod_rewrite" setting in local_staticpage's settings, the normal link isn't working anymore, only the mod_rewrite links will still work. That's intended behaviour.
I added
RewriteEngine On
RewriteRule ^/static/(.*)\.html$ /local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]
to the .htaccess of the moodle installation directory..
Please help
I can see in your screenshot that the configured Document directory (/home/centr135/moodledata/staticpage) doesn't exist. You need to create this directory and place some .html files there.
Did you follow the instructions in the plugin's README file?
Alex
sorry for the delay. I just published a version which fixed a bug with the language switcher on static pages and which could fix your problems. Please give it a try and let me know if it works for you now.
Alex
thank you for your feedback. I have some ideas what could be the problem, but I have to admit that I am quite busy with other things currently. I will have a look at it as soon as possible.
Perhaps you could answer me one question in the meantime: Do you run Moodle on a Windows server?
Alex
By Roberto
Error code: pagenotfound
Stack trace:
line 476 of \lib\setuplib.php: moodle_exception thrown
line 67 of \local\staticpage\view.php: call to print_error()"
Some more things to check:
- Does the webserver process (e.g. Apache) have file system permissions to read the static html-file?
- Could you please turn on Moodle debugging (/admin/settings.php?section=debugging) and check if there are any error messages when you try to open the URL of the static page in your browser?
- If the static html-file is placed within the webservers wwwroot, could you please try to open it directly in your browser, i.e. not through the static pages moodle plugin.
- Could you please post the URL of the static page to see if there are any typos?
did you install the very last version of the plugin (Build 2013032200)? In Build 2013031800 there was a flaw that static pages wouldn't show even if everything was configured correctly.
Greetings, Alex
I seem to have everything done right (Moodle2.4, no mod-rewrite) and the static html-file is found correctly as well. Unfortunately I get a "Page not found" inside my moodle after clicking the link to the file. Any idea?
Thanks in advance, Bernhard
Thanks for this - it would be interesting to understand what you mean by 'misusing a whole course' (ie:frontpage).