How to set site url/base url in wordpress?
To upgrade my website , I just downloaded all the files through FTP. And I am facing the issue that I am being redirected to live site every time.
So, I was not able to work on local site. For this I searched on net and found the below possible solutions and all of them are working fine..
1. in the top of the file “wp-config.php”, we can add ‘WP_HOME’ and ‘WP_SITEURL’ vars to
set the url to point to new location. if these are not available you can add them too.
define( 'WP_HOME', 'http://localhost/tutorialmines.net' ); define( 'WP_SITEURL', 'http://localhost/tutorialmines.net' );
2. In “wp_options” table set “siteurl” and “home” fields value by using mysql query.
select * from wp_options where option_name like '%siteurl%' ; select * from wp_options where option_name like '%home%' ;
3. To set urls in your wordpress application just go to Settings tab at left hand side and go to general tab and set site address(url) and wordpress address (url) just like below.
- After moving your site files (if necessary), log into your your WordPress Dashboard as an administrator.
- Next, click on Settings from the menu, and then General, Click on General to get started
- The two fields we’ll change are WordPress Address (URL) and Site Address (URL).
- Enter the URL you’d like to use. For this example, we’ll change the two fields to http://localhost/tutorialmines.net or http://www.tutorialmines.net or new site url, as per your needs.
- Scroll down the page and click on the Save Changes button.
Scroll down the page and click on the Save Changes button.
A you press the save button . The changes get reflected on the database as well and we can browse our site on local URL or any new changed URL as well.