Title: Changed Site Url- Cannot access wp_admin
Last modified: September 1, 2016

---

# Changed Site Url- Cannot access wp_admin

 *  Resolved [viva9](https://wordpress.org/support/users/viva9/)
 * (@viva9)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/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 [http://www.example.com/sub_dir](http://www.example.com/sub_dir).
   This lead to my website address to always appear as stated above, instead of 
   just [http://www.example.com](http://www.example.com).
 * In order to get rid of the sub directory suffix, I went through this post
    [https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using](https://codex.wordpress.org/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 [http://www.example.com](http://www.example.com)
   and left the WordPress URL to [http://www.example.com/sub_dir](http://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 [http://example.com](http://example.com),
   I am not able to access the admin dashboard etc. through [http://example.com/sub_dir/wp_admin](http://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 !

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Suraj Lulla](https://wordpress.org/support/users/srjlulla/)
 * (@srjlulla)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/changed-site-url-cannot-access-wp_admin/#post-7632288)
 * Go to phpMyAdmin, in your database find “wp_options” table.
 * Update the “siteurl” and “home” to your new url.
 *  Thread Starter [viva9](https://wordpress.org/support/users/viva9/)
 * (@viva9)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/changed-site-url-cannot-access-wp_admin/#post-7632346)
 * Suraj Lulla,
 * I have checked the database. The site URL is [http://www.example.com/sub_dir](http://www.example.com/sub_dir)
   and home is [http://www.example.com](http://www.example.com) which is the new
   url.
 *  Thread Starter [viva9](https://wordpress.org/support/users/viva9/)
 * (@viva9)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/changed-site-url-cannot-access-wp_admin/#post-7632427)
 * Got the access to the admin panel by deactivating the plugins in the database.
   Went to settings > Permalinks and clicked save. It generated a new .htaccess 
   file automatically.
 * Now the website is serviced from [http://example.com](http://example.com) and
   the wordpress from [http://example.com/sub_dir](http://example.com/sub_dir).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Changed Site Url- Cannot access wp_admin’ is closed to new replies.

## Tags

 * [wp_admin](https://wordpress.org/support/topic-tag/wp_admin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [viva9](https://wordpress.org/support/users/viva9/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/changed-site-url-cannot-access-wp_admin/#post-7632427)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
