WordPress.org

Ready to get started?Download WordPress

Forums

Problems with jQuery.load in WPMU (7 posts)

  1. spstieng
    Member
    Posted 3 years ago #

    I have created a plugin that works fine for single installation of WP. But now that I switched to WPMU I'm facing a problem.

    In my jQuery / Javascript, I have the following code to load content:
    jQuery("#fileBrowser").load("../wp-content/plugins/wp-filebrowser/fileBrowser.php");

    Instead of the normal 'http://mysite.com/wp-content/plugins/wp-filebrowser/fileBrowser.php', it now uses 'http://subdomain.mysite.com/wp-content/plugins/wp-filebrowser/fileBrowser.php'.

    This throws a '404 Not Found' when looking for uploader.php.

    I'm wondering how I can work around this problem.

  2. Then your subdomains are borked or your rewrite rules are incorrect.

    Because if everything else is working, then it should find it just fine. Yes, with the subdomain in there.

  3. spstieng
    Member
    Posted 3 years ago #

    Yeah, thought that it might be something like that.

    This is my .htaccess file that I had to create:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    and I added *.mysite.no to my httpd.conf file:

    <VirtualHost localhost>
        ServerName mysite.no
        ServerAlias *.mysite.no
        DocumentRoot I:\Development\wamp\www\mysite
    </VirtualHost>

    And my HOST file looks like this:

    127.0.0.1       mysite.no
    127.0.0.1       subdomain.mysite.no

    I'm not sure if there is anything out of the normal here.

  4. So does the subdomain work correctly otherwise? As in, without this plugin?

  5. spstieng
    Member
    Posted 3 years ago #

    Yes, I can access http://subdomain.mysite.no.
    http://subdomain.mysite.no opens a different site than http://mysite.no.

    I just uploaded the plugin to my "prod" server and it works fine there.
    So it's just on my locale machine.

  6. spstieng
    Member
    Posted 3 years ago #

    Crap!

    I take my last statement back. My WPMU was still running on v2.9.1.
    After upgrading to 3.0.1, and following your guide here (http://wpmututorials.com/how-to/upgrading-from-wpmu-to-wp-3-0/), my plugin stoped working.

    I get a '404 Not Found' on http://mysite.com/wp-content/plugins/wp-filebrowser/fileBrowser.php

    The "funny" thing is that when I look in Firebug in the response folder, it returns the HTML - but it is not displayed.

  7. spstieng
    Member
    Posted 3 years ago #

    I've found out where it fails on my server.

    In fileBrowser.php I have the following at line 1:
    require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');

    This is what causes the 404 error.

Topic Closed

This topic has been closed to new replies.

About this Topic