htaccess redirect problem

Hi,

I want all users to go from website.com or www.website.com to be directed to update.domain.com

Not working

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.211
RewriteCond %{REQUEST_URI} !^/ [NC]
RewriteRule ^(.*)$ http://update.domain.com/$1 [R=302,L]
LVL 3
Computer GuyAsked:
Who is Participating?
 
GaryConnect With a Mentor Commented:
That should be
RewriteRule (.*) http://update.domain.com [L,NC,R=301]

(missed it copying from my code samples)
0
 
GaryCommented:
RewriteCond %{HTTP_HOST} !^update\.domain\.com$ [NC]
RewriteRule ^blog/$ http://update.domain.com [L,NC,R=301]
0
 
Computer GuyAuthor Commented:
Sorry, all users except ones with a specific IP
0
 
GaryCommented:
Just add in your line then before the Rule
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.211
0
 
Computer GuyAuthor Commented:
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.211
RewriteCond %{HTTP_HOST} !^update\.domain\.com$ [NC]
RewriteRule ^blog/$ http://update.domain.com [L,NC,R=301]

what is the blog on line 3?

also, when they goto domain.com for any file they should be redirected to update.domain.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.