Skip to content

Instantly share code, notes, and snippets.

@xnite
Created December 7, 2015 14:37
Show Gist options
  • Save xnite/859565cebd6227855fc5 to your computer and use it in GitHub Desktop.
Save xnite/859565cebd6227855fc5 to your computer and use it in GitHub Desktop.
this conditional statement will modify Wordpress default behavior which redirects users to the primary url for your site. It will prevent this redirection & as long as the address used to access the website ends in `.onion`.
if( preg_match( '/\.onion$/', $_SERVER['HTTP_HOST'] ) )
{
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment