from http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29

WordPress address (URL)
WP_SITEURL, defined since WordPress Version 2.2, allows the WordPress address (URL) to be defined. The value defined is the address where your WordPress core files reside. It should include the http:// part too. Do not put a slash "/" at the end. Setting this value in wp-config.php overrides the wp_options table value for siteurl and overrides the WordPress address (URL) field in the Administration > Settings > General panel when logging in using wp-login.php. It will _not_ update your Home url. Read more about this in depth in the link provided in the Note field:

NOTE: It won't change the Database value though, and the url will revert to the old database value if this line is removed from wp-config. Use the RELOCATE constant to change the siteurl value in the database.
If WordPress is installed into a directory called "wordpress" for the domain example.com, define WP_SITEURL like this:

define( 'WP_SITEURL', 'http://example.com/wordpress' );
Dynamically set WP_SITEURL based on $_SERVER['HTTP_HOST']

define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wordpress' );
NOTE: A safer alternative for some installations would be to use the server-generated SERVER_NAME instead of the php/user-generated HTTP_HOST which is created dynamically by php based on the value of the HTTP HOST Header in the request, thus possibly allowing for file inclusion vulnerabilities. SERVER_NAME is set by the server configuration and is static.
Dynamically set WP_SITEURL based on $_SERVER['SERVER_NAME']

define( 'WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/path/to/wordpress' );
Blog address (URL)
WP_HOME is another wp-config.php option added in WordPress Version 2.2. Similar to WP_SITEURL, WP_HOME overrides the wp_options table value for home but does not change it permanently. home is the address you want people to type in their browser to reach your WordPress blog. It should include the http:// part and should not have a slash "/" at the end.

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