WebFaction
Community site: login faq

Hi there -- I've searched the forums for this and can't find it.

I have a multisite wordpress network which has caused www.mymaindomain.com to not work. I need the syntax for the mod_rewrite to redirect www.mymaindomain.com to mydomain.com

basically the syntax to this comment: Have in mind though, that *.mydomain.com also includes www.mydomain.com (it is just a regular subdomain). If you want to point www.mydomain.com to your Django app as well, you can use some HTTP redirect rule (via mod_rewrite), that would redirect the visitors from http://www.mydomain.com to http://mydomain.com.

asked 13 Jan '11, 09:03

dewey22
111
accept rate: 0%


You can redirect you application by following the documentation here:

http://docs.webfaction.com/software/static.html#redirect-a-domain-with-a-static-cgi-php-app

In the example, it redirects the non www version of your domain to the www version of your domain.

Change:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^myolddomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mynewdomain.com/$1 [R=301,L]

To:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.myolddomain.com$ [NC]
RewriteRule ^(.*)$ http://mynewdomain.com/$1 [R=301,L]
permanent link

answered 13 Jan '11, 11:31

aaronh ♦♦
1.3k3
accept rate: 34%

ahhh thanks so much!! I couldn't find the documentation!

permanent link

answered 14 Jan '11, 14:45

dewey22
111
accept rate: 0%

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:

×242
×13
×13

question asked: 13 Jan '11, 09:03

question was seen: 4,397 times

last updated: 14 Jan '11, 14:45

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