aboutsummaryrefslogtreecommitdiffstats
path: root/railties/configs
diff options
context:
space:
mode:
Diffstat (limited to 'railties/configs')
-rwxr-xr-xrailties/configs/apache.conf60
-rw-r--r--railties/configs/routes.rb11
2 files changed, 13 insertions, 58 deletions
diff --git a/railties/configs/apache.conf b/railties/configs/apache.conf
index 5548292f8d..0b2f4cd99e 100755
--- a/railties/configs/apache.conf
+++ b/railties/configs/apache.conf
@@ -1,61 +1,5 @@
-# General Apache options
-AddHandler fastcgi-script .fcgi
-AddHandler cgi-script .cgi
-Options +FollowSymLinks +ExecCGI
-
-# Make sure that mod_ruby.c has been added and loaded as a module with Apache
RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]
-# Change extension from .cgi to .fcgi to switch to FCGI and to .rb to switch to mod_ruby
-RewriteBase /dispatch.cgi
-
-# Enable this rewrite rule to point to the controller/action that should serve root.
-# RewriteRule ^$ /controller/action [R]
-
-# <caching>
-# no query string?
-RewriteCond %{QUERY_STRING} ^$
-
-# no POST method?
-RewriteCond %{REQUEST_METHOD} !^POST$ [NC]
-
-# Request filename is a directory?
-RewriteCond %{REQUEST_FILENAME} -d
-
-# Request filename + '/index' is a file?
-RewriteCond %{REQUEST_FILENAME}/index -f
-
-# Rewrite to request filename + '/index' and finish
-RewriteRule ^(.*)/?$ $1/index [QSA,L]
-
-# no query string?
-RewriteCond %{QUERY_STRING} ^$
-
-# no POST method?
-RewriteCond %{REQUEST_METHOD} !^POST$ [NC]
-
-# Request filename is a file?
-RewriteCond %{REQUEST_FILENAME} -f
-
-# Finish rewriting
-RewriteRule .* - [L]
-
-# Set default type of cached files to text/html
-DefaultType text/html
-# </caching>
-
-# Add missing slash
-RewriteRule ^([-_a-zA-Z0-9]+)$ /$1/ [R]
-
-# Default rewriting rules.
-RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([0-9]+)$ ?controller=$1&action=$2&id=$3 [QSA,L]
-RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ ?controller=$1&action=$2 [QSA,L]
-RewriteRule ^([-_a-zA-Z0-9]+)/$ ?controller=$1&action=index [QSA,L]
-
-RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([0-9]+)$ ?module=$1&controller=$2&action=$3&id=$4 [QSA,L]
-RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)$ ?module=$1&controller=$2&action=$3 [QSA,L]
-RewriteRule ^([-_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)/$ ?module=$1&controller=$2&action=index [QSA,L]
-
-# You can also point these error messages to a controller/action
ErrorDocument 500 /500.html
-ErrorDocument 404 /404.html \ No newline at end of file
diff --git a/railties/configs/routes.rb b/railties/configs/routes.rb
new file mode 100644
index 0000000000..0ff18338d0
--- /dev/null
+++ b/railties/configs/routes.rb
@@ -0,0 +1,11 @@
+ActionController::Routing::Routes.draw do |map|
+ # Add your own custom routes here.
+ # The priority is based upon order of creation: first created -> highest priority.
+
+ # Here's a sample route:
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Install the default route as the lowest priority.
+ map.connect ':controller/:action/:id'
+end