Solved

Rewrite rule question for subdomain

Posted on 2008-06-18
4
267 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
I meant www.cnn-news.1cyU.com :)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

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…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

856 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