问题:我已经在我的DocumentRoot中加载了Wordpress MU。 这个工作正常,但是我现在在DocumentRoot里面有两个项目,它们都有一个同名的目录:'plugins':/ var / www / html / cms / plugins / var / www / html / cms / sites /博客/可湿性粉剂内容/插件/。 我相信这是由于我目前的Apache安装而导致的冲突。 当我加载我的WP MU并login时,一切“看上去”都是正常的,但仔细观察,我发现由于Apache 404错误,没有加载任何插件。 示例: https://www.someplaceonline.ext/blogs/wp-content/plugins/active-directory-integration/css/adintegration.css?ver = 1.7.1
404没有find。
我不知道如何解决这个问题,所以我提供了我的Apache安装程序。
我已经试过了:将“ AliasMatch ^.*/plugins/(.*)$ /var/www/html/cms/plugins/$1 ”更改为AliasMatch ^\.\./plugins/(.*)$ /var/www/html/cms/plugins/$1 。 原因是:在我的cms目录内引用他们的“插件”通常以“..”为前缀,因此它们被格式化../plugins/someplugin/etc/etc.ext这继续加载正确的cms内的插件,并在http://www.regextester.com/validation我的正则expression式使我相信这应该可以解决这个问题,但是,项目,如https://www.someplaceonline.ext/blogs/wp-content/plugins/ active-directory-integration / css / adintegration.css?ver = 1.7.1仍然无法加载。
添加“ AliasMatch ^.*/wp-content/plugins/(.*)$ /var/www/html/cms/sites/blogs/wp-content/plugins/$1 ”。 我想我可以简单地附加一个新的AliasMatch来解决Wordpress的path映射,但是这也是行不通的。
相关目录结构:
/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/
相关的Apacheconfiguration:
<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>
### 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>
不,这是多余的,因为/博客已经等于/ var / www / html / cms / sites / blogs。
AliasMatch ^.*/site_resources(.*)$ /var/www/html/cms/site_resources/$1
也是其以前的目录块和别名定义的副本。
如果你想这个工作, 删除别名。
AliasMatch ^.*/plugins/(.*)$ /var/www/html/cms/plugins/$1
同样如上所述,添加的酱,这将永远不会在/ var / www / html / cms / sites / blogs / wp-content / plugins /
注意,别名应该以斜线结尾,除非你知道更好(你不知道)。
删除上面的前两个部分,告诉我们什么错误日志说,当你尖叫“404!”。