SHARE
TWEET

Untitled

a guest Sep 26th, 2012 474 Never
  1. <?php
  2. ! defined( 'ABSPATH' ) and exit;
  3. /* Plugin Name: Redirect Main Site To Sub-Site */
  4. function wpse66115_redirect_to_sub_site()
  5. {
  6.     if ( 'main-site' === $GLOBALS['wp']->request )
  7.         exit( wp_redirect( 'http://www.example.com/main-site/sub-site/', 301 ) );
  8. }
  9. add_action( 'parse_request', 'wpse66115_redirect_to_sub_site' );
RAW Paste Data
Top