View Single Post
Old 11-03-2011, 06:36 AM   PM User | #1
dev07
New Coder

 
Join Date: Aug 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
dev07 is an unknown quantity at this point
Unhappy Need help on root domain and subdomain htaccess

Hello everyone,

I have root domain [http://www.example.com] and a subdomain [http://news.example.com] . All files of root domain are kept in the root directory. It also includes the folder "news" which is used for the subdomain.

I am hosting my site from godaddy and i made the subdomain from the control panel and pointed the news folder for this subdomain.

I have a .htaccess file for root domain inside the root directory and another .htaccess file for sub-doamin inside the news folder.

The following code is written on the root domain's .htaccess :

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

ErrorDocument 404 /404.php

RewriteRule ^signup$ registration.php
RewriteRule ^login$ index.php
RewriteRule ^home$ index.php


On the other hand, the sub-domain's .htaccess is empty. Previously, above similar code was written. But that time, it was showing Internal server error. So, made it empty.

Few page names of root and sub-domain are same like registration.php, header.php, footer.php, content.php while some other pages are different by name. I have two separate 404.page for root and subdomain.


All the pages of my root domain can be accessible using http://www.example.com/signup and so on.
But the pages of sub-domain is not accessible using http://news.example.com/signup . Its displaying the custom 404.php page of subdomain which is different in design and content from the root domain's 404.php page. If i type http://news.example.com , its opening the index.php and displaying its content. If i type http://news.example.com/registration.php , then its displaying the content of sub-domain's regis

If i type, http://news.example.com/garbage or http://news.example.com/garbage.html then also its displaying the sub-domain's 404.php page.

Can anybody help me on this? Or guide me to write the .htaccess for root and sub-domain? I want to access all the pages of sub-domain with different name (different from the php page name) like the root domain.


Thanks in advance.
dev07 is offline   Reply With Quote