Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2012  |  syntax: None  |  size: 0.33 KB  |  views: 268  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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' );
clone this paste RAW Paste Data