0

Issue: I have loaded Wordpress MU inside of my DocumentRoot. This is working fine however, I now have two projects inside the DocumentRoot that both have a directory with the same name: 'plugins': /var/www/html/cms/plugins/ /var/www/html/cms/sites/blogs/wp-content/plugins/. I believe that this is causing a conflict because of my current Apache setup. When I load my WP MU up and sign in, everything "appears" to be normal but upon looking closely, I noticed that not a single plugin is loading due to Apache 404 error. Example: https://www.someplaceonline.ext/blogs/wp-content/plugins/active-directory-integration/css/adintegration.css?ver=1.7.1

404 Not found.

I am not sure how to fix this so I have provided my Apache setup.

What I have already tried: Changing "AliasMatch ^.*/plugins/(.*)$ /var/www/html/cms/plugins/$1" to AliasMatch ^\.\./plugins/(.*)$ /var/www/html/cms/plugins/$1. The reason: references inside of my cms directory to their 'plugins' usually are prefixed with '..', so they are formatted ../plugins/someplugin/etc/etc.ext This continues to load plugins correctly inside of the cms, and verifying my Regular expression at http://www.regextester.com/ leads me to believe this should work to solve the issue however, items such as https://www.someplaceonline.ext/blogs/wp-content/plugins/active-directory-integration/css/adintegration.css?ver=1.7.1 continue to fail to load.

Adding "AliasMatch ^.*/wp-content/plugins/(.*)$ /var/www/html/cms/sites/blogs/wp-content/plugins/$1". I thought I could simply append a new AliasMatch to resolve the path mapping for Wordpress but this also, does not work.

The relevant directory structure:

/var/www/html/
/var/www/html/cms/
/var/www/html/cms/memorybook/
/var/www/html/cms/plugins/
/var/www/html/cms/site_resources/
/var/www/html/cms/sites/
/var/www/html/cms/sites/blogs/

The relevant Apache configuration:

<VirtualHost *:80>
    DocumentRoot /var/www/html/cms/sites/

    #Host names
    ServerName www.someplaceonline.ext
    ServerAlias someplaceonline.ext
    ServerAlias www.spo.ext
    ServerAlias spo.ext

    <Directory "/var/www/html/cms/sites/">
       AllowOverride All
       Allow from All
    </Directory>

    ### This set of directives match the blogs on this server, which is outside of the document root. ###
    Alias /blogs /var/www/html/cms/sites/blogs
    <Directory "/var/www/html/cms/sites/blogs">
        AllowOverride All
        Allow from All
    </Directory>

    ### This set of directives match the memorybook folder which is outside of the doucment root. ###
    Alias /memorybook /var/www/html/memorybook
    <Directory "/var/www/html/memorybook">
        AllowOverride All
        Allow from All
    </Directory>

    ### This set of directive match the plugins folder which is outside of the document root. ###
    #Alias /plugins /var/www/html/cms/plugins
    #<Directory "/var/www/html/cms/plugins">
    #   AllowOverride All
    #   Allow from All
    #</Directory>

    ### This set of directive match the site_resources folder which is outside of the document root. ###
    Alias /site_resources /var/www/html/cms/site_resources
    <Directory "/var/www/html/cms/site_resources">
       AllowOverride All
       Allow from All
    </Directory>

    ### This must be last or else unwanted matches will occur. ###
    AliasMatch ^.*/site_resources(.*)$ /var/www/html/cms/site_resources/$1
    AliasMatch ^.*/plugins/(.*)$ /var/www/html/cms/plugins/$1
    #AliasMatch ^.*/wp-content/plugins/(.*)$ /var/www/html/cms/sites/blogs/wp-content/plugins/$1
</VirtualHost>
syn4k
  • 569
  • 1
  • 6
  • 12

1 Answers1

1
### This set of directives match the blogs on this server,
###     which is outside of the document root.
Alias /blogs /var/www/html/cms/sites/blogs
<Directory "/var/www/html/cms/sites/blogs">
    AllowOverride All
    Allow from All
</Directory>

No, this is superfluous since /blogs is already equal to /var/www/html/cms/sites/blogs.

AliasMatch ^.*/site_resources(.*)$ /var/www/html/cms/site_resources/$1

Also a duplicate of its previous Directory block and Alias definition.
If you want this one to work, remove the Alias.

AliasMatch ^.*/plugins/(.*)$ /var/www/html/cms/plugins/$1

The same again as above, with the added sauce that this will never end up at /var/www/html/cms/sites/blogs/wp-content/plugins/

NOTE that Aliases should end with a slash, unless you know better (you don't.)

Remove the first two sections above, and tell us what the error log says when you shriek "404!".

adaptr
  • 16,576
  • 23
  • 34