Solved

mod_rewrite rule on HTTP_HOST

Posted on 2014-04-30
1
227 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
1 Comment
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now