Setting the Wordpress base URL when switching to the virtual domain for localhost?

advertisements

I had a project on localhost, now in wamp I setted virtual domain. Now the local project opens fine on domain address but resource files on pages are not loading. In source code of pages css and js files are still linked with 'localhost' hence are not found.


Its very simple

Edit wp-config.php

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Edit functions.php

and add the line

<?php
update_option('siteurl','http://example.com');
update_option('home','http://example.com');
?>

Take care of permalinks .htacess file & database resources links

You can check here