I am a newbie to wordpress though I have programming background. Recently I moved a wordpress website from justhost shared server to a
linode vps server (Ubuntu OS). I did following steps to achieve it
- Set up apache2 server on vps
- Set up virtualhost on vps
-
Created a directory under /var/www/ftpadmin/www/
Note. ftpadmin was created to restrict ftp access to files under that folder. I could make work static html and php websites after doing so. -
Took backup of database and wp-content folder from justhost server of respective wordpress website.
-
Now on vps, at specified location above, first I download latest version of wordpress and unzipped the files.
-
Created database of same name at mysql and then imported original to the same database.
-
replaced new wp-content folder with the one from original one.
-
I was following instructions on https://www.digitalocean.com/community/articles/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps.
-
restarted apache server. Now I could access the home page.
-
I corrected the database values for wordpress url and site address url to new one at older location and reloaded database which helped me access dashboard and login pages also.
-
I created a .htaccess file like mentioned in http://ahsan.vimmaniac.com/blog/enabling-wordpress-permalinks-on-ubuntu/.
-
I also changed “AllowOveride” under both section in /etc/apache2/sites-available/ as
<Directory /> Options FollowSymLinks AllowOverride all </Directory> <Directory /var/www/ftpadmin/www/domainname> RewriteEngine On Options Indexes FollowSymLinks MultiViews AllowOverride FileInfo Order allow,deny allow from all </Directory>
-
restarted service apache once again.
-
One final point, I am using a custom template and so I have a header.php and header-sub.php file for homepage and navigation.
-
Now here is the problem. When I click on any submenu I get “Internal Server Error”.
-
If I remove .htaccess and reload apache server. Now I get 404 error while clicking on and submenu.
Any help is highly appreciated? I looked at various sites to collate these many steps and execute. I have no Idea what I should do to correct this situation. But when I go dashboard -> All pages, I can find all pages existing there with contents.
Thanks in Advance
Fayaz
EDIT
Added .htaccess
file from comment:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/ (wordpress replaced with my domainname, bottom also)
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
I got the above problem fixed by just replacing
RewriteBase /wordpress/ as “RewriteBase /”
and
RewriteRule ./wordpress/index.php [L} as “RewriteRule . /index.php [L]”.
in .htaccess file.
Finally fixed this errow after browsing for a couple of hours and trying many options.
In this block in your Apache httpd.conf file, (located in my CentOS instance at $ sudo vi /etc/httpd/conf/httpd.conf)
change AllowOverride None to AllowOverride All.
Src: https://wordpress.org/support/topic/secondary-or-child-pages-returning-a-404-error-after-wp-34-update#post-3830892