Question

Apparently there is a .htaccess file in my root directory which is messing up all of my other sites that are in the directory.

I am currently using GoDaddy as my host.
This is the situation i am facing:

  • I have a main domain which is hosted directly in the root folder
    (ex. the index file would be found at /root/index.php)
  • I have some other domains hosted in folders inside the sub-directories
    (ex. root/domain2/index.php)
  • the other websites work correctly.
  • the main domain is built with concrete 5, the rest is built by basic php and html, using notepad++
  • subdomains for the other domains are not working since they do not have access in the .htAccess file
  • Now my question is that,
    Since I cannot erase the .htAccess file, how could I manage making the subdomains?
    The .htaccess file is used only for the concrete website but is controlling everything for some reason, is there any way to fix it?

    Thanks!

    P.S. I was not the one building the concrete website, i was building the rest of the domains, so i do not clearly know how to use it. All i know is that once i erase the .htaccess the subdomains are working and the main domain in the root directory only allow to visit the index page of it.

    Just to be clear, There is a main site, lets call it site 1, which is hosted in the main directory, and there are the other sites, ex. site2-site5, Which i want to make subdomains for and it is not working unless i erase the .htaccess file.

    I hope the question is clear enough, if not and more details are needed, please tell me.

    Was it helpful?

    Solution

    .htaccess files, by design, impact the directory they are placed in and all directories below them see http://httpd.apache.org/docs/2.2/howto/htaccess.html#what.

    With your current setup, you could create a new .htaccess in the htdocs folder for each subdomain and it would override the one higher up.

    Even better would be to serve the main domain and the subdomains from different parent directories. For example, say your current site is www.example.com, and your subdomains are site1.example.com and site2.example.com.

    I suggest something like this for your directory setup:

    /var/www/example.com/www/htdocs 
    /var/www/example.com/site1/htdocs
    /var/www/example.com/site2/htdocs
    

    This way, what is in use for www.example.com has no impact on site1.example.com.

    This would also prevent the possible duplicate content issues you'll face with having subdomains inside the primary domain htdocs folder.

    For example, if your current setup is like this:

    /var/www/example.com/www  <-- main doman
    /var/www/example.com/www/site1 <-- site1.example.com
    

    Then going to www.example.com/site1 would show you the same content as going to site1.example.com, which would be a negative SEO signal to google.

    Licensed under: CC-BY-SA with attribution
    Not affiliated with StackOverflow
    scroll top