@Mariasole: If I understand your problem correctly then:
1) You have a collection of HTML pages which are currently static and encoded with UTF-8.
2) You have some dynamic pages which you want to run through LC Server.
3) You want to be able to add some dynamic elements to *some* of the currently static HTML pages.
In general, it is much much better to let Apache serve static pages directly, leaving only the dynamic ones to go through LC Server / PHP / any other CGI-like thing. The reason here is that there is a significant performance cost to serving dynamic pages compared to static pages.
Okay, my suggestion for getting things working right now (which has already been suggested - in part) would be to use different extensions for these two types of pages - htm/html for the static ones and lc/lcs for the dynamic ones. You can then change the extensions of the pages as you add dynamic elements to them.
However, I'm guessing that your pages have links between each others so you *cannot* change the name of any of the files easily. However, I think a solution to this would be to use rewriting rules in the .htaccess file (take a look here
https://www.addedbytes.com/articles/for ... beginners/) to map a uniform set of filenames to the actual filenames:
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^originalname.htm dynamicname.lc [NC,L]
This should work as rewriting occurs *before* Apache tries to serve a page. So, when a user clicks on a link in one of your pages with the name 'mysite.com/mypage.htm', Apache will look through the rewriting rules, and will map that to 'mysite.com/mypage.lc' - *if* you have a rewriting rule which maps from mypage.html -> mypage.lc. If there is no such rule, it will just serve mypage.htm. (Note, in this case you should remove .html and .htm from the AddHandler livecode-script clause).
This approach would mean adding a new rewrite rule every time you added dynamic elements to a page, which (at least initially) should be okay to maintain as long as you have many many many more static pages than dynamic ones.
I've spent a bit of time thinking about this, and I've not yet thought of another way to solve this problem beyond @SparkOut's suggestions of prepending all your files with
Code: Select all
<?lc put header "Content-Type: text/html; charset=utf-8" ?>
. There is definitely some work needed on LC Server to help with this situation, and it should be possible to solve now that the engine supports Unicode transparently. (Indeed, I think your problem is similar / related to
http://quality.livecode.com/show_bug.cgi?id=17244 although I need to spend some more time understanding that bug report!).