404 in rails

If you need to show a 404 error page from your controller without using an exception, this could help:

render :file => "#{RAILS_ROOT}/public/404.html",  :status => 404 and return

Rails 2: authenticate_or_request_with_http_basic and Apache

I’ve tried to use the new authenticate_or_request_with_http_basic function of Rails 2 to include a simple authentication for some special pages in an application. But Apache kept refusing authorization, even if the authenticate_or_request_with_http_basic-block was set to be always true.

To fix this, add or change this in your public/.htaccess (if using FastCGI):

RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

Keywords: rails2 rails http authentication error bug refusing apache problem

Save my life

Another piece of great emo

Okkervil River

That’s what I’d call EMO.

Localization problem with Wordpress 2.3

I’ve transferred a wordpress system to another server which runs PHP 5. The language file didn’t work anymore. After one annoying hour I’ve found out that the gettext functions are buggy.

Solution:

That’s all.

Keywords: wordpress, localization, php 5, language file, problem, 64 bit, gettext, de_DE.mo


linkboost