WebFaction
Community site: login faq

Hi,

I'd like to know what's the best way to redirect all traffic from http://mywebsite.com to http://www.mywebsite.com for a website running on the Rails/NGinx config.

Thanks in advance for your help, Thomas.

asked 16 Jan '11, 12:00

tbalthazar
1613
accept rate: 0%


The easiest way to do a redirect is to create an additional Static/CGI/PHP application to handle requests to mywebsite.com.

Remove mywebsite.com from your current rails site. Create a new Static/CGI/PHP application. Then, create a new site named redirect. Select mywebsite.com as the domain, and add your new redirect application to the URL path of /. You will then need to edit your .htaccess file to handle the redirect.

We have documentation explaining it here: http://docs.webfaction.com/software/static.html#redirect-a-domain-with-a-static-cgi-php-app

permanent link

answered 16 Jan '11, 12:40

aaronh ♦♦
1.3k3
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×185
×107
×74

question asked: 16 Jan '11, 12:00

question was seen: 4,119 times

last updated: 16 Jan '11, 12:40

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM