Welcome Guest | Login

.htaccess rewritecond problem

I have my app set up to assign subdomains to individual users, while serving static files from www.

That works fine.

I would like to allow people to sign up from a page in the www subdomain by tying one request from that subdomain to the main app - www.domain.com/sign_up. The following .htaccess doesn't work, and I can't figure out why:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{http_host} !^www\. [NC, OR]
RewriteCond %{request_uri} sign_up
RewriteRule ^(.*)$ dispatch.fcgi [QSA, L]

Any ideas?

2008-09-16 03:54 PM

Can you be more specific with your requirement.

Please mention the URL link that you want to rewrite and also mention the link to which you want to rewrite. Also remember not to mention the domain names here. Use something like http://subdomain.com/xyz ---> http//domain.com to specify your requirement.

2008-09-16 04:04 PM

Regards,
Rahul
Right now http://[any subdomain].domain.com/[any url] is correctly routed to my rails app.
http://www.domain.com/[any url] serves static pages from the public folder of the rails app.

I want http://www.domain.com/signup to be picked up by the rails app, the way [any other subdomain].domain.com/signup would be.

Thanks.

2008-09-16 04:56 PM

I checked your .htaccess entries and couldn't find this line added there.
=
RewriteCond %{request_uri} sign_up
=
Anyways I have edited the .htaccess file now. can you check the uRLs and confirm current working status. I think everything is working fine now.

2008-09-16 08:11 PM

Regards,
Rahul
Thanks, Rahul, though I'm still not sure what happened. I thought I was making changes to .htaccess by uploading them to /current through the cPanel file manager. Should I have uploaded to the latest release directory instead? Opening /current/public/.htaccess with vi gave me the chance to tweak it a little more. It works now.

2008-09-16 10:49 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.