I have a cgi/perl program that I want to use on the same server as my
RoR app and I keep getting:
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
I load the program to the cgi-bin directory in its own folder /cgi-bin/
fump/
In the /public folder of my app I have the following .htaccess file:
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .pl .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain
requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteEngine On
# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
# Alias /myrailsapp /path/to/myrailsapp/public
# RewriteBase /myrailsapp
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which
will be rendered instead
#
# Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "<h2>Application error</h2>Rails application failed
to start properly"
In the /public_html folder I have this .htaccess file:
Options +FollowSymlinks
RewriteEngine on
### redirect subdomains to user profile page ###
RewriteCond %{HTTP_HOST} !^www\.timefreedomnow\.net [NC]
RewriteCond %{HTTP_HOST} !^support\.timefreedomnow\.net [NC]
RewriteCond %{HTTP_HOST} ([^.]+)\.timefreedomnow\.net [NC]
RewriteRule ^(.*)$ http://www.timefreedomnow.net/profile/%1 [L,R]
### redirect subdomains to user profile page ###
RewriteCond %{HTTP_HOST} !^www\.greatcareerplan\.com [NC]
RewriteCond %{HTTP_HOST} !^support\.greatcareerplan\.com [NC]
RewriteCond %{HTTP_HOST} ([^.]+)\.greatcareerplan\.com [NC]
RewriteRule ^(.*)$ http://www.greatcareerplan.com/profile/%1 [L,R]
### redirect /support to greatcareerplan.zendesk.com ###
RewriteCond %{HTTP_HOST} ^support\.timefreedomnow\.net [NC,OR]
RewriteCond %{HTTP_HOST} ^support\.greatcareerplan\.com [NC]
RewriteRule ^(.*)$ http://greatcareerplan.zendesk.com/$1 [L,QSA]
### redirect from old GCP username address's ###
### http://www.greatcareerplan.com/?username ###
### to ###
### http://www.greatcareerplan.com/profile/username ###
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^([a-z0-9]+)$ [NC]
RewriteRule .* /profile/%1? [L,R=301]
### Redirect all incoming request for GCP domain's to Ruby On Rails
Application ###
RewriteCond %{REQUEST_URI} !^/cpanel/.*
RewriteCond %{REQUEST_URI} !^/support/.*
RewriteCond %{REQUEST_URI} !^/tr/.*
RewriteCond %{REQUEST_URI} !^/_mmServerScripts/.*
RewriteCond %{HTTP_HOST} ^(www\.)?timefreedomnow\.net [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?greatcareerplan\.com [NC]
RewriteRule ^(.*)$ /gcp/$1 [L,QSA]
Does anyone know how to make this work?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---