WordPress.org

Support

Support » Multisite » WP Network and FQDN redirect

WP Network and FQDN redirect

  • Rab

    @rab-rrdev

    Hi,

    We’re running a WordPress Network as an intranet site(s). It’s on a RedHat box with the following VirtualHost;

    <VirtualHost *:80>
        ServerName csi.our.company.uk
        ServerAlias csi csi.our.company.uk
        ServerAdmin postmaster@our.company.uk
        DocumentRoot /var/www/html/
        ErrorLog logs/csi
    </VirtualHost>

    Internally it’s accessed via http://csi/, here’s the .htaccess file;

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    We have two external sites connecting into our network via VPN and we’re unable to get it working. We have another Joomla site, which I have no experience with, and that works okay. What the Joomla site does is allow people to view the site through both http://joomla/ and http://joomla.our.company.uk/ without redirecting. WordPress however removes the FQDN and puts it on the local address which the external VPN sites can’t resolve.

    Is there any way we can allow people to browse our WordPress network via both http://csi/ and http://csi.our.company.uk/ without it redirecting to the set site URL?

Viewing 3 replies - 1 through 3 (of 3 total)
  • grosshat

    @grosshat

    How do you config the domain on WordPress network?

    BTW, ServerAlias does not need ‘csi.our.company.uk’, since it is the ServerName.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    WP doesn’t really do well with ‘two’ URLs like that. Did this work with a single site install?

    Rab

    @rab-rrdev

    Hi,

    Thanks for the replies.

    @grosshat, do you mean how it’s configured in wp-config? It has,

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'csi');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    @ipstenu, back before I moved the site onto a WordPress network it wasn’t available to these remote sites so I’m not sure what would have happened. If it’ll help, I can create another blank single WP install and see but I have a feeling it’ll be much the same.

    What I had thought about, and I’m not even sure this is possible or would work, is change DOMAIN_CURRENT_SITE to the FQDN and use mod_rewrite to strip off the large FQDN so the URLs look nicer. I don’t know enough about it though to determine if this would be a solution.

    Cheers,
    Rab

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Network and FQDN redirect’ is closed to new replies.
Skip to toolbar