LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [solved] How to redirect all request to www. url?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2013, 10:18 AM
nadlerz nadlerz is offline
New Member
 
Join Date: Jan 2013
Posts: 5
Default [solved] How to redirect all request to www. url?

I have 3 domains pointing on the same forum.
I want all of the 3 domain's will use www version.

Thanks !

Last edited by NiteWave; 01-06-2013 at 06:44 AM..
Reply With Quote
  #2  
Old 01-05-2013, 09:41 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
use rewriterule to do it

RewriteCond %{HTTP_HOST} domain1.com [OR]
RewriteCond %{HTTP_HOST} domain2.com [OR]
RewriteCond %{HTTP_HOST} domain3.com
RewriteRule (.*) http:///www.domain.com/$1 [R=301,L]
Reply With Quote
  #3  
Old 01-06-2013, 05:39 AM
nadlerz nadlerz is offline
New Member
 
Join Date: Jan 2013
Posts: 5
Quote:
Originally Posted by NiteWave View Post
use rewriterule to do it

RewriteCond %{HTTP_HOST} domain1.com [OR]
RewriteCond %{HTTP_HOST} domain2.com [OR]
RewriteCond %{HTTP_HOST} domain3.com
RewriteRule (.*) http:///www.domain.com/$1 [R=301,L]
But I want those 3 domains still function and can be use.
I want them to force www. version.

Like.
domain.net will redirect to www.domain.net
domain.me will redirect to www.domain.me
domain.info will redirect to www.domain.info

Not to redirect theme all to a single www url.
Reply With Quote
  #4  
Old 01-06-2013, 05:53 AM
nadlerz nadlerz is offline
New Member
 
Join Date: Jan 2013
Posts: 5
I'm using this before:

Quote:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.domain\.net$
RewriteRule ^(.*)$ http://www.domain.net/$1 [R=301,L]
Is the right?

Or I should remove:
Options +FollowSymLinks
RewriteBase /
Reply With Quote
  #5  
Old 01-06-2013, 06:28 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
base on your description, it looks what you want is:

RewriteEngine on

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

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

RewriteCond %{HTTP_HOST} ^domain\.info$ [NC]
RewriteRule ^(.*)$ http://www.domain.info/$1 [R=301,L]
Reply With Quote
  #6  
Old 01-06-2013, 06:36 AM
nadlerz nadlerz is offline
New Member
 
Join Date: Jan 2013
Posts: 5
It works now
Your the man !

So no need for this codes:

Options +FollowSymLinks
RewriteBase / ?
Reply With Quote
  #7  
Old 01-06-2013, 06:43 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
as long as it's working now, no need those extra 2 lines.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:52 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.