# Urgent help with rails, htaccess and shared hosting

**URL:** <https://www.ruby-forum.com/t/urgent-help-with-rails-htaccess-and-shared-hosting/120593>\
**Category:** Rails\
**Created:** [November 18, 2007, 11:49pm UTC](https://www.ruby-forum.com/t/urgent-help-with-rails-htaccess-and-shared-hosting/120593 "2007-11-18T23:49:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [November 18, 2007, 11:49pm UTC](https://www.ruby-forum.com/t/urgent-help-with-rails-htaccess-and-shared-hosting/120593/1 "2007-11-18T23:49:46Z")

</div>

Hi, i’m trying to set up a rails project in a shared hosting (i’ve no  
access to the vhost configuration).  
Actually i’ve a project folder in httpdocs. And this is the .htaccess in  
httpdocs

RewriteEngine On  
RewriteRule ^$ /project/public/index.html [L]  
RewriteCond %{REQUEST\_URI} !^/project/public  
RewriteRule ^(._)$ /project/public/$1 [L]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(._)$ project/public/dispatch.fcgi/$1 [QSA,L]

When i access to the domain it works quite fine, and also the db seems  
to works. The only problem i’ve is that i use the resources methods to  
create the urls. So i use for example login\_account\_url to generate the  
url to the login page. But it generate an url like  
“[http://www.domain.com/project/public/account/login](http://www.domain.com/project/public/account/login)” instead of  
“[http://www.domain.com/account/login](http://www.domain.com/account/login)”. How can i fix this and set the  
public folder as root (without using the apache vhost config)?  
The problem is not just that “/projecy/public/” it’s ugly, it’s that it  
doesn’t work if there is that ☹

Thanks
