thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

.htaccess changes and testing particularly for existing installs for upgrading #333

Closed ronm123 closed 9 years ago

ronm123 commented 9 years ago

Hi all I've just started testing the xerte3 beta code with apache set to true and a working .htaccess file from one of my 2.1 installs. Has anyone else been testing this too and/or adding new rules to htaccess.conf where required? Has anyone tested this since the new editor was added? I've only just started testing this but clearly there are a number of installs out there which use .htaccess including the one at UON and unfortunately once this has been in use in an install I think there's not really any going back to not using the .htaccess because all the bookmarked, embedded and linked LO's will break. So I think it's an important area to test and ensure everything is working and won't break upgraded installs. The first problem is testing everything thoroughly. Would definitely be good to have a definitive test list for this - anyone got one? The other problem is how/where to add or at least document any new rules required for those upgrading? As I've been looking at the export and syndication functionality and committed a fix to syndication_change_template.php I've immediately noticed a .htaccess issue with the offline export which doesn't currently work with .htaccess enabled because there isn't a current rule to deal with /website_code/php/scorm/export.php?offline=true&scorm=false&template_id=2&html5=true&flash=false

I think that should be something like: rewriteRule ^export_([0-9]+)?(.)$ /website_code/php/scorm/export.php?offline=true&scorm=false&template_id=$1&$2 but that isn't working so may not be correct.

How do we deal with this efficiently now and in future?

ronm123 commented 9 years ago

Oh dear - I think this is quite a biggie :-( Just noticed the editor doesn't event open with .htaccess enabled e.g. fails at http://localhost/xerte3/edithtml_2

torinfo commented 9 years ago

i'll have a look later tonight.

JohnSmith-LT commented 9 years ago

Pretty sure if you just add after the edit rule line in .htaccess

rewriteRule ^edit_([A-Za-z0-9]+)?(.)$ /edit.php?template_id=$1&$2

this new line

rewriteRule ^edithtml_([A-Za-z0-9]+)?(.)$ /edithtml.php?template_id=$1&$2

Then that should take care of edit...

ronm123 commented 9 years ago

Cheers John that works for edit. I know Tom said he was going to look at the rules required too but while I'm testing any ideas what the rule for offline export should be? The full link is something like /xerte3/website_code/php/scorm/export.php?offline=true&scorm=false&template_id=2&html5=true&flash=false

I tried a few variations in the .htaccess but given there are already rules that begin with the following: export_ exportlocal exportfull scorm2004_ scormrich scorm_

I'm not sure what to use for offline export?

JohnSmith-LT commented 9 years ago

I've committed that edithtml line to the htaccess.conf file that is deployed during setup but we need to figure out how that line is added to an existing htaccess file during upgrade @torinfo because at present an upgrade doesn't change any of that... or do we leave that to the upgrade instructions? Or do we get rid of edithtml.php completely and pass a parameter to edit.php such as edit.php?wizard=javascript&template_id=x

Has your export rule never worked @ronm123 ? If it has then what has changed now in the new code? Do you have any urls that worked before that don't anymore?

ronm123 commented 9 years ago

@JohnSmith-LT it's just the new offline export that doesn't work without a new rule. I haven't got that working yet. All the others work ok. I've manually added to the rules on different installations over the years and if I remember correctly Tom and I worked through some issues with the order of some of the rules too at one point. So I'm not sure there's an easy way to automatically update the rules for different installations during upgrade and my set of rules may well contain outdated rulles now too (see example here: https://dl.dropboxusercontent.com/u/1388941/htaccess_example.txt )

We obviously do need to flag this up and document somewhere. We've talked recently about adding release notes somewhere which could include system requirements and upgrade steps. I guess details and guidance could be combined with that and flagged up during installation and in the upgrade guide? We really only want a single point of access and definitive list of the rules required. Perhaps that is the htaccess.conf with a link to it on github?

torinfo commented 9 years ago

exportfull and exportlocal didn't work either.

I added exportoffline to the htaccess.conf file.

Please note the order of the rules!!! The exportfull, exportlocal and exportoffline have to be in the .htaccess file BEFORE export_

torinfo commented 9 years ago

Comitted