Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1752 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[PATCH] Add documentation about when RewriteBase is required in apache.conf

Reported by: dave@cherryville.org Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version: 0.13.1
Severity: normal Keywords:
Cc:

Description

The default htaccess file is unusable for a Rails application that is accessed via an Apache Alias directive.

From http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritebase:

"If your webserver's URLs are not directly related to physical file paths, you have to use RewriteBase in every .htaccess files where you want to use RewriteRule directives."

In my case, I tried to do the following in my httpd.conf

Alias /myrailsapp /path/to/myrailsapp/public

But when I tried to access http://myserver/myrailsapp, Apache would generate the following error:

mod_rewrite: maximum number of internal redirects reached. Assuming configuration error.

The solution is to use the RewriteBase directive in the htaccess file, for example:

RewriteBase /myrailsapp

This wasn't an easy problem to diagnose, there is a lot of mod_rewrite documentation to go through.

Attachments

apache.conf.patch (0.5 kB) - added by dave@cherryville.org on 07/15/05 18:11:38.

Change History

07/15/05 18:11:38 changed by dave@cherryville.org

  • attachment apache.conf.patch added.

07/17/05 09:22:23 changed by david

  • status changed from new to closed.
  • resolution set to fixed.