Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New Coder
    Join Date
    Aug 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please help me friends..

    Trying to figure out the issue and fix , but i am failing to do so..


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •