WebFaction
Community site: login faq

Is there a way that I can get all site (I am currently running 4 small sites) to redirect the www. to the root domain using only one additional application? I know I can create four additional appliactions each with a static/php app redirecting each of the domains, I am just looking for a universal shortcut.

asked 23 Jan '11, 15:45

joshfinnie
961913
accept rate: 0%


Try a more generic rule,

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

That should redirect for any site incoming. Above code found on,

http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www
permanent link

answered 23 Jan '11, 16:12

johns
5.4k312
accept rate: 23%

edited 23 Jan '11, 16:12

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:

×76
×10

question asked: 23 Jan '11, 15:45

question was seen: 3,501 times

last updated: 23 Jan '11, 16:12

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