1

I have two WordPress websites set up for learning purposes on my localhost. One is a clone of the other, and both are accessible through different loopback addresses in my /etc/hosts file. When logging into the cloned website (duplicatetestsite.com), the login redirects me to the original website's admin panel (testsite1.com) even though they have separate databases and configurations. Before logging into the second one both are different websites. I can tell because one has an extra post.

I have localhost with two different hostname for different address.

The following is a part of my /etc/hosts

127.0.0.1       testsite1.com www.testsite1.com
127.0.0.5       duplicatetestsite.com www.duplicatetestsite.com
  • Both are installed in different folders as well as are connected to
  • separate databases. Contents of both wp-config.php file are different.
  • Both have different virualhost file for apache server.

I have done the following to troubleshoot.

  1. Verified virtual host configuration for duplicatetestsite.com.
  2. Confirmed separate databases and configurations.

Both have different virtualhosts configured for apache.

Virtual Host Configuration:

testsite1.com (127.0.0.1):

<VirtualHost 127.0.0.1:80>
    ServerName testsite1.com
    ServerAlias www.testsite1.com
    DocumentRoot /srv/www/wordpress
    <Directory /srv/www/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /srv/www/wordpress/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>

duplicatetestsite.com (127.0.0.5):

<VirtualHost 127.0.0.5:80>
    ServerName duplicatetestsite.com
    ServerAlias www.duplicatetestsite3.com
    DocumentRoot /var/www/wordpress3
    <Directory /var/www/wordpress3>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /var/www/wordpress3/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>

I would appreciate any help regarding why this redirect is happening and how to fix it so I can log in to duplicatetestsite.com without being redirected. Additional Info This is on LAMP stack on my machine.

3
  • wordpress.stackexchange.com
    – Gantendo
    Commented Mar 15 at 12:34
  • @Gantendo Are you sure it has nothing to do with my computer network setting. Commented Mar 15 at 12:48
  • @paneer_curry - It might but all questions about Wordpress are out of scope.
    – Ramhound
    Commented Mar 15 at 13:37

0

You must log in to answer this question.

Browse other questions tagged .