The MU forums have moved to WordPress.org

No-www (9 posts)

  1. Vimm
    Member
    Posted 16 years ago #

    I'm attempting to install WordPress on a server but right now I'm staring at a No-www message on the install page. I appreciate the sentiment and I've done it on my servers for 10 years, however I am not installing this on a top level domain and I have no control over the use of "www". It was preordained long before I entered the picture. The fact is, if you remove the www it won't resolve so enforcing this No-www rule (by stripping it out) prevents me from using WordPress.

    I'm using sub-directories, so is it possible for me to disable this so that I can use the url I've been given which starts with "www."?

  2. drmiketemp
    Member
    Posted 16 years ago #

    Actually if the domain won't resolve without the www, there's some RFCs being violated.

    But anyway, I believe we just covered this 2 days ago:

    http://mu.wordpress.org/forums/topic.php?id=5752

    Hope this helps,
    -drmike

  3. Vimm
    Member
    Posted 16 years ago #

    Thanks, that helps. All of our services use a reverse proxy so yes, it technically resolves without the "www" but there's nothing configured there on port 80.

  4. drmiketemp
    Member
    Posted 16 years ago #

    Yea, there's reasons why not to use the non-www version. It really becomes an issue with folks add the 'www' bit in as a forth level tld.

    If you do get it working 100%, please consider writing up a specific step by step write up. If you didn't notice from that other thread, I was kind of winging it.

  5. Vimm
    Member
    Posted 16 years ago #

    Got it working. I had to zap several places in index-install.php and another in wpmu-settings.php. I also had to be naughty and alter $_SERVER variables in order to make it work through our proxy. I'll test everything for a bit and then post what lines I commented out.

  6. drmike
    Member
    Posted 16 years ago #

    Thanks. (I don't remember any bit in the wpmu-settings.php file...)

  7. Vimm
    Member
    Posted 16 years ago #

    Here are the lines to comment out in index-install.php.
    238-239
    358-359
    459-463
    471

    I also have the changes to wpmu-settings.php.

    Add proxy support:
    Insert before:
    $domain = addslashes( $_SERVER['HTTP_HOST'] );

    // Naughty, but effective proxy support.
    if (isset($_SERVER['HTTP_X_FORWARDED_HOST']))
    	$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
    	$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];

    Disable no-www:
    Comment out the following lines after:
    $domain = addslashes( $_SERVER['HTTP_HOST'] );

    if( substr( $domain, 0, 4 ) == 'www.' )
    	$domain = substr( $domain, 4 );
  8. SteveAtty
    Member
    Posted 15 years ago #

    Did you really need to go and drag up all these old posts just to basically spam your blog all over the site?

  9. tdjcbe
    Member
    Posted 15 years ago #

    I could have sworn someone tried that previously and ran into problems.

About this Topic