Solved

Rewrite rule question for subdomain

Posted on 2008-06-18
4
262 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Fonts cannot be displayed with Firefox and Internet Explorer 6 216
how to configure and install nginx ? 1 434
Read Config:: values from another file 2 85
XAMPP 3 54
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…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

20 Experts available now in Live!

Get 1:1 Help Now