Question

  • Creator
    Topic
  • #2140425

    One root folder 2 subdomains

    by vusald ·

    Hello everyone
    Can someone hint me decision…
    I have one root folder in var/www/html/mydomain
    and 2 subdomain
    1. sub1.mydomain.com
    2. sub2.mydomain.com

    when I type sub1.mydomain.com in a browser, it opens required index.php.. It os ok
    But when I type sub2.mydomain.com it opens the same page, but I need sub2.mydomain.com/tpm/login.php to be opened (login.php located in /var/www/html/mydomain/tpm directory)

    How do I fix this simple issue’;

You are posting a reply to: One root folder 2 subdomains

The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our Community FAQs for details. All submitted content is subject to our Terms of Use.

All Answers

  • Author
    Replies
    • #2413639

      Re: login.php

      by kees_b ·

      In reply to One root folder 2 subdomains

      The server doesn’t look in subdirectories (like tpm) for a file called index.php, let alone for a file called login.php. You’ll have to program that yourself.

    • #2414069

      use .htaccess

      by bhawani1 ·

      In reply to One root folder 2 subdomains

      You can redirect the same using .htaccess file.
      RewriteEngine On
      RewriteBase /

      RewriteCond %{HTTP_HOST} !^www\.
      RewriteCond %{HTTP_HOST} subdomain\.domain\.com
      RewriteCond $1 !^sd_
      RewriteRule (.*) /tpm/login.php$1 [L]

    • #2419961

      Do not use

      by steventillson02 ·

      In reply to One root folder 2 subdomains

      Do not use the same folder for the same domains .

Viewing 2 reply threads