"public", how to remove it? + htaccess question. Help Please

Hi, i’ve a little app which is working without problems, but i’ve a
little annoyance. I’m using the cool rest methods, like users_url, but
when i do this the result is www.domain.com/public/users, how can i
remove the “/public” string to get just www.domain.com/users ?
The other question is about htaccess, what do set in there? do you use
just the one in the public folder or do you put one also in the root
project folder? I’ve my project in the http_public (i’m using a shared
hosting for now), and now i’ve an htaccess which redirects every
requests to the public folder, but in this way i can’t have any other
directories in the root, but i’ve to put them in the rails public
folder.

my htaccess is this:

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ /public/index.html [L]
RewriteCond %{REQUEST_URI} !^/public
RewriteRule ^(.)$ /public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.
)$ public/dispatch.fcgi/$1 [QSA,L]

thanks

On Thu, 2008-02-28 at 21:20 +0100, Xdmx X. wrote:

folder.
You may want to set up your DocumentRoot to be the public/ directory.

Yours,

Tom

Tom C. wrote:

On Thu, 2008-02-28 at 21:20 +0100, Xdmx X. wrote:

folder.
You may want to set up your DocumentRoot to be the public/ directory.

Yours,

Tom

Hi, i’ve tried to set DocumentRoot public/
the temporally index.html page has been showed correctly, but when i try
something which use rails like domain.com/other/home doesn’t work: 500
internal server error from apache.
How have to set the .htaccess? one .htaccess in the root folder with
just DocumentRoot public/ and another .htaccess in the public folder
with the standard rails .htaccess, or just one .htaccess in the root
with everything in there?
Thanks

Xdmx X. escribió:

Tom

Hi, i’ve tried to set DocumentRoot public/
the temporally index.html page has been showed correctly, but when i try
something which use rails like domain.com/other/home doesn’t work: 500
internal server error from apache.

Hi, what said [development|production].log?(when show error 500)


Rafael Garcia Ortega

DocumentRoot directive must be in virtual host configuration file.
Example:

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName foo.com
ServerAlias www.foo.com bar.com www.bar.com
DocumentRoot /absolute_path_to/public

Regards

Xdmx X. escribió:

DocumentRoot public/
RewriteRule ^(.)$ public/dispatch.fcgi [QSA,L]
DocumentRoot public/
RewriteRule ^(.
)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

#############


Rafael Garcia Ortega

Rafael García wrote:

Hi, what said [development|production].log?(when show error 500)

Sorry for the late, i was trying something, anyway…
this is the apache error (nothing in production.log):

#############

[Sun Mar 09 11:46:58 2008] [alert] [client 81.208.x.x]
/home/dom1/public_html/domain.com/.htaccess: DocumentRoot not allowed
here

#############

this is caused by:

#############

DocumentRoot public/

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ public/index.html [QSA]
RewriteRule ^([^.]+)$ public/$1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

#############

and:

#############

DocumentRoot public/

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

#############

with this htaccess everything works fine, but it leaves the public
referer in the url, and it hasn’t to be there:

#############

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ public/index.html [QSA]
RewriteRule ^([^.]+)$ public/$1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ public/dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

#############

Xdmx X. escribió:

Is it possible to do it using the .htaccess file? Because I don’t have
any access to the virtual host configuration, but only to the .htaccess
(and I can’t change hosting for now :frowning: )

Another solution can be put a symlink from rails_root/public to
/home/dom1/public_html/domain.com or specify rails_root/public as domain
directory.

Regards


Rafael Garcia Ortega

Rafael García wrote:

DocumentRoot directive must be in virtual host configuration file.
Example:

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName foo.com
ServerAlias www.foo.com bar.com www.bar.com
DocumentRoot /absolute_path_to/public

Regards

Is it possible to do it using the .htaccess file? Because I don’t have
any access to the virtual host configuration, but only to the .htaccess
(and I can’t change hosting for now :frowning: )

Rafael García wrote:

Another solution can be put a symlink from rails_root/public to
/home/dom1/public_html/domain.com or specify rails_root/public as domain
directory.

Regards

I’ll try with the last one, because i don’t know if i could have a ssh
access.
Thanks

Xdmx X. wrote:

I’ll try with the last one, because i don’t know if i could have a ssh
access.
Thanks

Nothing… any way to do this using just the .htaccess file? i can use
only that :frowning:

Are you confident your host has support for Rails?

Xdmx X. wrote:

Xdmx X. wrote:

I’ll try with the last one, because i don’t know if i could have a ssh
access.
Thanks

Nothing… any way to do this using just the .htaccess file? i can use
only that :frowning:

Rick Martinez wrote:

Are you confident your host has support for Rails?

Yes, in the panel there is rails (the hosting is bluehost)

Are you following their recipe?

http://helpdesk.bluehost.com/kb/index.php?x=&mod_id=2&id=232


Anibal Rojas
http://hasmanydevelopers.com
http://rubycorner.com
http://anibal,rojas.ve

On Mar 14, 8:24 pm, Xdmx X. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs