Solved

htaccess redirect problem

Posted on 2013-11-09
5
304 Views
Last Modified: 2013-11-09
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
Comment
Question by:Computer Guy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39636398
RewriteCond %{HTTP_HOST} !^update\.domain\.com$ [NC]
RewriteRule ^blog/$ http://update.domain.com [L,NC,R=301]
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 39636420
Sorry, all users except ones with a specific IP
0
 
LVL 58

Expert Comment

by:Gary
ID: 39636422
Just add in your line then before the Rule
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.211
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 39636424
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
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39636430
That should be
RewriteRule (.*) http://update.domain.com [L,NC,R=301]

(missed it copying from my code samples)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
What You Need to Know when Searching for a Webhost Provider
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question