tkdhanasekar
tkdhanasekar

Reputation: 63

wordpress multisite secondary site not working

i installed wordpress multisite using apache2 , mariadb and php7.3 on ubuntu 18.04 , the primary site http://hashq.in works fine , the secondary site http://site4.hashq.in/ is redirecting to default apache page and dashboard page http://site4.hashq.in/wp-admin/ is also displaying 404 page not found my wp-config.php is

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'hashq.in');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/* That's all, stop editing! Happy publishing. */

and the .htaccess file is

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>

and the /etc/apache2/sites-available/wordpress.conf is

<VirtualHost *:80>
     DocumentRoot /var/www/html/wordpress/
     ServerName hashq.in
     ServerAlias www.hashq.in

     <Directory /var/www/html/wordpress/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

and i followed this site to configure the multisite https://websiteforstudents.com/setup-wordpress-multisite-with-apache2-mariadb-php-7-2-on-ubuntu-16-04-17-10-18-04/

any clues to resolve the issue , thanks

Upvotes: 0

Views: 735

Answers (1)

tkdhanasekar
tkdhanasekar

Reputation: 63

the issue multisite secondary site not working error 404 page not found is sorted by adding the entry

ServerAlias *.hashq.in

in the /etc/apache2/sites-available/wordpress.conf file and then restart the apache server this solves the issue this will be discussed already https://wordpress.stackexchange.com/questions/19588/multisite-getting-a-404-for-additional-site-created-using-subdomain-install

Upvotes: 0

Related Questions