Hardcode WordPress Site URL

by damonp on January 11, 2011

in Snippets

I’m working on a project for mobile devices and need to be able to setup the same WordPress install on both the .mobi and the .com domain. This snippet lets you hardcode the URL and home configurables in wp_config.php. We use one setup of configurables for the .mobi side and another set for the .com.

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

Thanks to the WordPress Codex.

Popularity: 2%

Most Popular Posts

Damon Parker is a freelance sysadmin and web developer in Texas. He specializes in server setup, server security and high performance server configurations. Need help setting up a web server or getting a server back online after a crash or hack? Email Damon

Leave a Comment

Previous post:

Next post: