Changed Site Url- Cannot access wp_admin
-
Hi,
I had my website and WordPress installed in a sub directory. So my WordPress URL and Site URL both pointed to https://www.example.com/sub_dir. This lead to my website address to always appear as stated above, instead of just https://www.example.com.
In order to get rid of the sub directory suffix, I went through this post
https://codex.www.ads-software.com/Giving_WordPress_Its_Own_Directory#Using a pre-existing subdirectory install, which explains how to service the website from root while having WordPress in a sub directory.In the WordPress -> General section, I changed the Site URL to https://www.example.com and left the WordPress URL to https://www.example.com/sub_dir.
Thereafter, I just copied index.php and .htaccess file from the sub_dir to the root. In the root/index.php file, I changed the line that said:
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
to the following, using your directory name for the WordPress core files:
require( dirname( __FILE__ ) . ‘/sub_dir/wp-blog-header.php’ );HOWEVER, I did not do the following step, because I thought I am not using Permalink structure.
If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)
Although I am able to access my website partially with the URL https://example.com, I am not able to access the admin dashboard etc. through https://example.com/sub_dir/wp_admin and instead get an error –
“The example.com page isn’t working – is currently unable to handle this request. HTTP ERROR 500”Can someone please help me understand the issue and suggest some solution.
If it is because I did not generate the .htaccess file, how can I go about doing it now, given that I cannot access wp_admin.
Is there any other solution that I should try?Please help !
- The topic ‘Changed Site Url- Cannot access wp_admin’ is closed to new replies.