Anurag Rana
Anurag Rana

Reputation: 1466

Addon domain and second wordpress installation not working

I already had a Wordpress installation in public_html/wp directory for my primary domain name lets say domain-one.com. Now I added an addon domain domain-two.com with root directory as public_html/govt. Now I installed wordpress again for domain-two.com within directory wp. So now I have below directory structure -

enter image description here

my first website i.e. domain-one.com was and is working fine. However if I go to domain-two.com/wp/wp-admin/ it doesn't show me login/dashboard screen instead below screen is shown.

enter image description here

In public_html/ directory there are .htaccess and index.php file (for domain-one.com), while in public_html/govt/ there are no such file.

Content of public_html/.htaccess file

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Content of public_html/index.php file

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );

What should I do so that domain-two.com shows login/dashboard screen?

UPDATE 1: After going through this article, I created an .htaccess file (and index.php) in public_html/govt folder and put the below content in it. I tried with content of root folder htaccess file as well. But still the problem is same in both cases.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /govt/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /govt/index.php [L]
</IfModule>

# END WordPress

Upvotes: 0

Views: 1478

Answers (2)

jasleen K
jasleen K

Reputation: 1

I guess for each domain hosted :wordpress auto generate .htaccess file and in .htaccess file, code is also the same as you posted here. and else addon domains are added only with CPANEL: addon domain software like here:

Step1

step1

Step 2

step2

Step 3

step3

Step 4

step4

Upvotes: 0

stack kid
stack kid

Reputation: 117

Try to install WordPress manually. I had the same issue. Just download WordPress, extract it and then shift the whole WordPress files in this folder. If you have already created dB, then change the config.php else it will ask you for the db creation. I hope this helps.

Upvotes: 0

Related Questions