I tried to change the old URLs of my website to the new website URLs. The old domain was https://example.com/sophie (a subdomain) and the new domain was https://newexample.com (examples). However, I got a 500 internal error when I click links on the updated website. The homepage is working well. More information: I manually changed the sites URL in the database with:
/* MySQL: */ update wp_options set option_value = 'https://newexample.com' where option_name = 'siteurl'; update wp_options set option_value = 'https://newexample.com' where option_name = 'home';
and in wp-config with: define('WP_HOME','https://newexample.com'); define('WP_SITEURL','https://newexample.com');
I cleared the cache of the server and the browser after adding those lines.
What went wrong? And how can I solve this?
My guess is that, you forgot to update the .htaccess
file. Try editing that file and inside it, you might see something like this in the screenshot(sample):
Instead of the wordpress
, yours might be sophie
(the folder name). Just remove that word along with the trailing slash, and most probably it should work.
So, after removing that folder name, it would look something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>