WordPress.org

Ready to get started?Download WordPress

Forums

install as subdomain with virtual host/proxy (Stanford) (1 post)

  1. jsoell
    Member
    Posted 2 years ago #

    This is my first wordpress install, so I'm a little in the dark here. I have some previous experience with PHP (it's been a while) and WordPress (fairly little) and more with HTML/CSS, but I've never done an install.

    Also, the Stanford group I'm making the site for uses spilf.stanford.edu as their site address even though their actual space is stanford.edu/group/spilf. So I installed WP through Stanford's backend (through stanford.edu/group/spilf), and it automatically installs WP in the cgi-bin/wordpress subfolder instead of the root. I followed the basic "Giving WordPress Its Own Directory" instructions, but I still get nothing when I go to either stanford.edu/group/spilf or spilf.stanford.edu.

    Two side nuggets (not sure if they matter, but I'll put them anyway). 1. There's now a 404 error even when I got to stanford.edu/group/spilf/cgi-bin/wordpress, but I'm less concerned about that right now.

    2. I activated a "reverse proxy" plugin that came with the WP install through the Stanford backend. The code is below.

    Thanks in advance!

    Desperate in Silicon Valley -

    thomas

    _ _ _ _ _

    <?php
    /*
    Plugin Name: Stanford Reverse Proxy
    Description: Turn this on after you set up this blog to work with a reverse proxy.
    Version: 1.1
    Author: Marco Wise
    Author URI: http://www.stanford.edu/dept/its/

    Copyright (c) 2007-2011 Board of Trustees, Leland Stanford Jr. University.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

    Neither the name of Stanford University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */

    # Disable the Canonical Filter
    remove_filter('template_redirect', 'redirect_canonical');

    # Strip out extraneous path information from REQUEST_URI
    # but only if page is requested from a reverse proxy
    if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
    $su_rewritebase = $_SERVER['SCRIPT_NAME'];
    $su_rewritebase = preg_replace('/\/(?:wp\-admin\/)?[-\w]*\.php$/', '', $su_rewritebase);
    $pattern = preg_replace('/\//', '\/', $su_rewritebase);
    $_SERVER['REQUEST_URI'] = preg_replace("/$pattern/", '', $_SERVER['REQUEST_URI']);
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic