## General plugins (Local): Static Pages

local_staticpage
Maintained by University of Ulm, Alexander Bias
Moodle plugin which displays information pages which exist outside any course, imprint or faq pages for example, complete with Moodle navigation and theme
11k
511
10

The local_staticpage plugin is designed to fetch a static HTML document from disk, enrich it with Moodle navigation and theme and deliver it as a standard Moodle page which exists outside any course.

Static pages will be available on catchy URLs like http://www.yourmoodle.com/static/faq.html and can be linked from Moodle HTML blocks, from your Moodle theme footer and so on. Using the local_staticpages plugin, you can create information pages within moodle, but without misusing a whole course just for showing a textbox.

### Contributors

Alexander Bias: Developer

• Thu, Aug 14, 2014, 4:44 PM
Dear Dharmendra,

honestly, local_staticpage is nothing you should start with when you start learning and working with Moodle. Using this plugin is somehow difficult as all of the comments above will show you. Also, local_staticpage is _no_ tool to make a complete Content Management System out of Moodle.

Alex
• Fri, Aug 22, 2014, 10:52 PM
Hi,
I've been trying to setup 2-3 static pages for my site. The plugin is installed correctly Mod_rewrite is fully enabled, page was created using html. Permissions have been changed.

I get this message in local staticpages>
From the document file's filename, Moodle derived the following pagename:
contact

The document is available and can be linked to at the following URL:

The document should be available to at the following clean URL, but actually a browser won't be able to download and view it (perhaps there is something wrong with your webserver or mod_rewrite configuration - see README file for details):

My hosting has also looked into the problem, do you have any suggestions?

Thanks,
• Sat, Aug 23, 2014, 1:35 AM
Richard,

please look above at the comment from Darrel Tenter from Nov 2013. He posted two slightly different rewrite rules which might work for Moodle installations in subdirs.

Alex
• Sat, Aug 23, 2014, 1:35 AM
Richard,

please look above at the comment from Darrel Tenter from Nov 2013. He posted two slightly different rewrite rules which might work for Moodle installations in subdirs.

Alex
• Sat, Aug 23, 2014, 6:35 AM
Hi Alex,
Thank you, I have one last question from hosting, is the mod compatible with 2.7 ?
• Sat, Aug 23, 2014, 1:12 PM
Richard,

did it work?
Could you please post the working RewriteRule here so I can add it to the README file?

The current module version works with 2.7. The dedicated 2.7 version will be posted within the next days to the Plugin repository.

Alex
• Sat, Aug 23, 2014, 1:12 PM
Richard,

did it work?
Could you please post the working RewriteRule here so I can add it to the README file?

The current module version works with 2.7. The dedicated 2.7 version will be posted within the next days to the Plugin repository.

Alex
• Wed, Nov 5, 2014, 8:27 AM
I'm unclear from here if you need to have your own access to the server maybe via FTP to set up the pages.
-Derek
• Wed, Nov 5, 2014, 2:50 PM
Derek,

yes, at the moment you have to be able to upload the static page files directly to a directory on your server. If you don't have direct access to the files on your server, you won't be able to use this plugin.

There's a plan on our roadmap to support in-browser uploads for static page files. But it has no priority...

Alex
• Wed, Apr 29, 2015, 5:48 PM
Hello Alexander
we have a problem with the plugin. We have installed it accordingly you're documantation Added a rewite rule in the .htaccess file in the html dir.
RewriteEngine On
RewriteRule ^/static/(.*)\.html$/local/staticpage/view.php?page=$1&%{QUERY_STRING} [L]

When we turn on the option Force Apache mod_rewrite we get an error:
error: File does not exist: /usr/local/moodle/test.uplearning.nl/html/static, referer: https://test.uplearning.nl/admin/settings.php

could you help us solving this problem

kind regards
• Thu, Apr 30, 2015, 2:31 AM
Hi Ed,

I know from several feedbacks that the rewrite option is not simple to setup and to use.

Does the plugin work without switching the "Force Apache mod_rewrite" setting on?

Alex
• Thu, Apr 30, 2015, 1:06 PM
Hello Alexander
yes. the rest of the plugin works fine. All the documents are added, except for,
The document should be available to at the following clean URL, but actually a browser won't be able to download and view it (perhaps there is something wrong with your webserver or mod_rewrite configuration - see README file for details):

I have tested the rewrite rule at http://htaccess.madewithlove.be/ works fine
Do you have any suggestions??

Ed
• Tue, May 5, 2015, 7:19 PM
Hi Ed,

I'd like to ask once again as it's not completely clear to me:
- If you turn the "Force Apache mod_rewrite" setting off, can you display a static page in Moodle?
- Where does the "error: File does not exist: /usr/local/moodle/test.uplearning.nl/html/static, referer: https://test.uplearning.nl/admin/settings.php" error message appear? On the Moodle settings page or when you try to open the static page in your browser?

Alex
• Wed, May 6, 2015, 1:55 PM
Hello Alex,
sorry for not being clear.
When the "Force Apache mod_rewrite" setting is off we can display the static pages.
The error is from the apache log and in the browser there is a message 404 error.

Eddy
• Wed, May 6, 2015, 3:30 PM
Hi Ed,

ok, if you can use the plugin without the rewrite rules, then the plugin is basically working and I can only provide limited support from here on because the rewrite problems are too heterogenous to discuss them in detail here...

The Apache error message tells you that it is looking for a file /usr/local/moodle/test.uplearning.nl/html/static and that file does not exist.

If you use the rewrite rule from https://github.com/moodleuulm/moodle-local_staticpage/blob/master/README.md and have built a URL for the static page like http://www.yourmoodle.com/static/faq.html, I would assume that the rewrite rule is _not_ in effect in your webserver because your webserver tells you that it can't find a file called "static" in your webroot - it does _not_ rewrite the URL to /local/staticpage/view.php?page=faq as it should. So, it's no problem of Moodle or the plugin, but of your webserver.

At this point, I would like to ask you to dig into your webserver configuration to see what's going wrong or ask someone who knows your environment better than I.

Thanks,
Alex