WebFaction
Community site: login faq

i have a site in another server, site1.com.br. i have a site in webfaction, site2.com.br

i want that when i put site2.com.br in my broswer, i want to be redirect to site2.site1.com.br. so i accessed the control panel of the site1 server, and i added a subdomain, site2. but i need to put the ip address of the site that will be pointed by this subdomain.

a admin told me that i can't access a webfaction site by ip.

what must i do?

asked 07 Jun '11, 12:24

vitorh45
134
accept rate: 0%


You can use an .htaccess file to do the redirection.
Add this to your or create a .htaccess file at the base of your site.

Redirect permanent site2.com.br site1.com.br
order deny,allow

permanent link

answered 07 Jun '11, 15:28

timg ♦♦
1.3k4
accept rate: 30%

i'm using django. i read about using rewrite like this: RewriteRule / http://site2.site1.com.br$1 but i think there is one problem.

in my external server, i can add 1 subdomain for my domain. so i added site2 as a subdomain. but in the control panel, in dns manager i need to put the ip address of site2.com.br. but i can't access a site in webfaction by ip.

(08 Jun '11, 09:07) vitorh45

You do not need to access the site by IP - you won't be typing an IP in your browser, but site2.com.br.

If site2.com.br is properly pointed to our servers, and you want people that visit the site to be redirected to site2.site1.com.br, then all you need to do is create a Static/CGI/PHP application that would do the redirect as described at http://docs.webfaction.com/software/static.html#redirect-a-domain-with-a-static-cgi-php-app . This applicaiton must be mounted on the http://site2.com.br website.

(08 Jun '11, 09:17) tie

the external server is Linode

(08 Jun '11, 09:39) vitorh45

let me explain better. i am confuse =/. is my first time dealing with this kind of situation.

i created in my server (linode) one domain and subdomain for a test: vitorh45.com.br and teste.vitorh45.com.br.

and my site that is running in webfaction is vitorh45teste.com.br.

in the linode control panel there is a field that i must put the IP of the site that will be pointed by my subdomain, teste.vitorh45.com.br. i put the IP of another site that is in the linode too, vitorh45.com.br.

in the http.conf of my site, vitorh45teste.com.br i added this: RewriteEngine on RewriteRule / http://teste.vitorh45.com.br$1.

it's working. when i access vitorh45teste.com.br i am redirected to teste.vitorh45.com.br, and my site, vitorh45.com.br, appears.

i needed to put an IP address in the config of my subdomain.

(08 Jun '11, 13:54) vitorh45
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:

×97
×76

question asked: 07 Jun '11, 12:24

question was seen: 5,251 times

last updated: 08 Jun '11, 14:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 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