I've been trying to integrate s9y into an existing mostly static HTML site. I say mostly static, since server side includes (SSI) are allowed. This did take some trickery, but it is almost complete. Here is what I did. I have a directory in my existing site called 'blog'. This directory has an index.html file that contains my site's look-and-feel with the following include:
Code: Select all
<!--#include virtual="/s9y/index.php"-->
This URL points to my s9y installation which has the "embed" option turned on. Now, when someone accesses the index.html file, they see the front page of the blog. However, when clicking links, it directs them to the real blog without the headers and footers. This was fixed by adding an .htaccess file in the s9y directory with the following rules, in addition to changing the s9y index file to "index.html".
Code: Select all
RewriteEngine on
RewriteCond %{QUERY_STRING} /admin$
RewriteRule ^index\.html.*$ /s9y/serendipity_admin.php [L]
RewriteCond %{QUERY_STRING} /feeds/
RewriteRule ^index\.html(.*)$ /s9y/index.php$1 [L]
RewriteRule ^index\.html(.*) /blog/index.html$1 [L]
RewriteRule ^$ /blog/index.html
The RewriteCond lines allow the admin pages and feeds to pass through without getting the static HTML information added on. Now, all of the links in the blog work since they are always redirected through the static HTML file.
Everything is working except for the search. This seems odd since the search parameters are just sent in the URL. In fact, here is a URL with search terms where the search doesn't work (the front page of the blog comes up instead):
Code: Select all
http://foo.com/blog/index.html?serendipity%5Baction%5D=search&serendipity%5BsearchTerm%5D=findme
However, if you simply change the '.html' to '.php', the search does work; although you won't get the site's headers and footers since they aren't being added on my the rewrite rules.
The question is, what is preventing the search from working?