Solved

Rewrite rule question for subdomain

Posted on 2008-06-18
4
268 Views
Last Modified: 2010-03-04
Hello,

For my domain www.1cyu.com, I created a subdomain from the control panel of my provider. BNow I have www.cnn-news.1cyu.com redirected to www.1cyu.com/cnn-news

I would like the url displayed in the browser to be www.cnn-news.1cys.com
It is still displayed www.1cyu/cnn-news/index.php when I type www.cnn-news.1cyu.com

I am trying the following rewrite rule without luck.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?1cyu\.com
RewriteRule ^/cnn-news/?(.*) http://cnn-news.1cyu.com/$1 [R=301,L]

0
Comment
Question by:ornicar
[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
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Kamran Arshad
ID: 21819490
Hi,

Ask your provider if there is an A record for "cnn-news.1cyu.com" in the zone file. There should be a separate A record for your above subdomain like below:

1cyu.com                      IN A      10.0.0.10      
cnn-news.1cyu.com      IN A      10.0.0.10      
0
 
LVL 16

Accepted Solution

by:
Blaz earned 125 total points
ID: 21819772
You are trying to fix things on www.1cyu.com site which is in my opinion wrong.

You should first (and only) fix the www.cnn-news.1cyu.com site that it won't redirect to www.1cyu.com. Contact your provider on how to do that - it seems that what you configured now is not correct. Without knowing your configuration interface at the provider we can't help much other than general guidelines.

It seems that you configured the domain www.cnn-news.1cyu.com to redirect to www.1cyu.com/cnn-news. This is wrong. You should have configured a new web site that points to the same folder on the disk or create a server alias which would result in an address of www.cnn-news.1cyu.com/cnn-news
0
 
LVL 9

Author Comment

by:ornicar
ID: 21821901
Thanks to pointing to my mistake.

The config interface is Confixx Pro, in which I defined this:

1cys.com    --->   /   (root dir)
www.1cys.com ---->  / (root dir)
www.cnn-news.1cys.com ---> www.cnn-news.1cyu.com/cnn-news (WRONG)

I suppose the first two are ok, and that I don't need any rewrite rule. Cool!
I corrected the third entry to
www.cnn-news.1cys.com ---> /cnn-news
and it works fine. Thank you very much for your help..





0
 
LVL 9

Author Comment

by:ornicar
ID: 21821930
I meant www.cnn-news.1cyU.com :)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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