Solved

mod_rewrite rule on HTTP_HOST

Posted on 2014-04-30
1
238 Views
Last Modified: 2014-05-15
We are trying to capture any request that comes into our Apache server with a specific word in the domain and re-direct it to a specific page.

We currently have the following:

RewriteCond %{HTTP_HOST}   ^(.*)\.hydrochroma\.(.*)$ [NC]
RewriteRule ^/(.*)         http://dev.cp.com [R=301,L]

Basically we want anything with hydrochroma to be re-directed. The above rule traps everything and re-directs.

Any feedback will begreatly appreciated.
0
Comment
Question by:Jorge Fraser
[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
1 Comment
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 40034661
You can simplify the rule a bit:
RewriteCond %{HTTP_HOST} hydrochroma [NC]
RewriteRule ^/?.* http://dev.cp.com [R=301,L]

Open in new window

Really, it should work as-is.  Can you light up your RewriteLog, and paste the entries for a single attempt?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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