LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   [solved] How to redirect all request to www. url? (http://www.litespeedtech.com/support/forum/showthread.php?t=6532)

nadlerz 01-05-2013 10:18 AM

[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 !

NiteWave 01-05-2013 09:41 PM

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]

nadlerz 01-06-2013 05:39 AM

Quote:

Originally Posted by NiteWave (Post 42566)
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.

nadlerz 01-06-2013 05:53 AM

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 /

NiteWave 01-06-2013 06:28 AM

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]

nadlerz 01-06-2013 06:36 AM

It works now :)
Your the man !

So no need for this codes:

Options +FollowSymLinks
RewriteBase / ?

NiteWave 01-06-2013 06:43 AM

as long as it's working now, no need those extra 2 lines.


All times are GMT -7. The time now is 02:58 PM.