Solved

Rewrite rule question for subdomain

Posted on 2008-06-18
4
261 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
  • 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
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

22 Experts available now in Live!

Get 1:1 Help Now