• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

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]
0
Computer Guy
Asked:
Computer Guy
  • 3
  • 2
1 Solution
 
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
 
GaryCommented:
That should be
RewriteRule (.*) http://update.domain.com [L,NC,R=301]

(missed it copying from my code samples)
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.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now