Tag: apache

Fixing “Too many redirects” error in MediaWiki

I run a wiki for my ParrotCichlid.com fish fancier’s site, based on “MediaWiki.” It had been running fine, except for an increasing problem with spam, but one day it simply stopped working. Browsing to the site would result in the following error message:

Too many redirects occurred trying to open “http://parrotcichlid.com/book/index.php/Main_Page”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.


(Click to enlarge image)

Continue reading

Conditional SSI

I was having trouble writing a javascript that sniffs the browser for IE or non-IE, then selects a server side include (SSI) based on the result.

It turned out that you cant do that with javascript: first of all it seems to mis-read the include string:

document.write('<!--# include virtual="includes/safety.htm" -->');

The browser sees this as comment and lops everything off after the (‘ even though the string has quotes around it. If I use a to escape the ! as !, then it simply writes the whole string out to the page, rather than interpreting it.

Apparently this is because SSI’s are evaluated on the server, so they are already executed before the browser renders the page – so by the time my page gets rendered, it’s too late.

Continue reading