简体   繁体   English

.htaccess为WordPress多站点导致随机错误500?

[英].htaccess for WordPress multi-site causing random error 500?

I have a fresh WordPress 3.2 site and have activated multi-site for it. 我有一个新的WordPress 3.2网站,并为它激活了多站点。 I am hosting this on a shared CPanel account and the WordPress install is in the root /public_html folder. 我在共享的CPanel帐户上托管这个,WordPress安装在root / public_html文件夹中。 I have it set for wildcard subdomain blogs. 我为通配符子域博客设置了它。

The problem is that I have been getting a lot of random Internal Error 500's (every 10 minutes), so my host said that it is because of .htaccess. 问题是我得到了很多随机内部错误500(每10分钟),所以我的主持人说这是因为.htaccess。 So they deleted .htaccess and now my site no longer gets the error 500's. 所以他们删除了.htaccess,现在我的网站不再收到500的错误。

Why could this be happening? 为什么会发生这种情况? Any ideas on what the problem could be and how to fix it? 关于问题可能是什么以及如何解决它的任何想法? Any help or advise is greatly appreciated. 非常感谢任何帮助或建议。

Below are the only logs I have from CPanel. 以下是我从CPanel获得的唯一日志。 Just a bunch of file not found errors, which I can't understand why this would cause it. 只是一堆文件未找到错误,我无法理解为什么会导致它。 It sounds a lot like this but no resolution was determined there: http://wordpress.org/support/topic/multisite-default-htaccess-rules-cause-infinite-loop-1 听起来很像这样,但没有确定解决方案: http//wordpress.org/support/topic/multisite-default-htaccess-rules-cause-infinite-loop-1

[Mon Oct 03 12:34:22 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://user234tech.com/wp-admin/network/plugins.php?deactivate=true&plugin_status=all&paged=1&s=
[Mon Oct 03 12:34:22 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/3dc97e86a78d6d3786305e7ff8d89180.css, referer: http://user234tech.com/wp-admin/network/plugins.php?deactivate=true&plugin_status=all&paged=1&s=
[Mon Oct 03 12:34:19 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:19 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/3dc97e86a78d6d3786305e7ff8d89180.css, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:19 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:19 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/3dc97e86a78d6d3786305e7ff8d89180.css, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:18 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:18 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/3dc97e86a78d6d3786305e7ff8d89180.css, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:18 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:34:18 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/3dc97e86a78d6d3786305e7ff8d89180.css, referer: http://subdomain1.user234tech.com/wp-admin/plugins.php
[Mon Oct 03 12:12:19 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/500.shtml, referer: http://user234.co/wp-admin/network/index.php
[Mon Oct 03 12:09:37 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml, referer: http://user234.co/wp-admin/network/index.php
[Mon Oct 03 12:09:37 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/dd406ba6ef3849450071a811b5b94568.css, referer: http://user234.co/wp-admin/network/index.php
[Mon Oct 03 11:55:08 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml
[Mon Oct 03 11:55:08 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/phpinfo.php,
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/favicon.ico
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/favicon.ico
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/404.shtml
[Mon Oct 03 11:54:21 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/favicon.ico
[Mon Oct 03 11:51:26 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/500.shtml
[Mon Oct 03 11:50:56 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/500.shtml
[Mon Oct 03 11:50:54 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_html/500.shtml
[Mon Oct 03 11:47:45 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/somedomain3.com/404.shtml
[Mon Oct 03 11:47:45 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/somedomain3.com/favicon.ico
[Mon Oct 03 11:47:45 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/somedomain3.com/500.shtml
[Mon Oct 03 11:47:42 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/billing.user234tech.com/404.shtml
[Mon Oct 03 11:47:42 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/billing.user234tech.com/favicon.ico
[Mon Oct 03 11:47:42 2011] [error] [client xx.xx.xx.xx] File does not exist: /home/user234/public_sites/billing.user234tech.com/500.shtml

Here is my .htaccess by the way: 顺便说一句,这是我的.htaccess:

# BEGIN WordPress

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]

# END WordPress

I just ran into this myself...and, luckily, after hours... just found the answer. 我自己就碰到了这个......幸运的是,经过几个小时......刚刚找到答案。

The problem was that I manually added a 2nd domain name as a ServerAlias in my httpd.conf file. 问题是我在httpd.conf文件中手动添加了第二个域名作为ServerAlias。 HOWEVER, that 2nd domain was not setup as a parked domain via the control panel. 但是,第二个域未通过控制面板设置为停放域。

My fix... 我的修复......

STEP 1: Remove (comment) the ServerAlias lines in the httpd.conf file that referenced my secondary (alias) domain. 步骤1:删除(注释)引用我的辅助(别名)域的httpd.conf文件中的ServerAlias行。 Restart httpd. 重启httpd。

STEP 2: Go to my primary domain name in cPanel and ADD PARKED DOMAIN. 第2步:转到cPanel和ADD PARKED DOMAIN中的主域名。 This sets up my secondary domain in a subdirectory of the website. 这会在网站的子目录中设置我的辅助域。 (If you don't do step 1 you will get an error message). (如果您不执行第1步,则会收到错误消息)。

STEP 3: Go back and manually edit the httpd.conf file and comment out the cPanel generated block for the secondary domain. 步骤3:返回并手动编辑httpd.conf文件并注释掉辅助域的cPanel生成块。 I don't want it going to a subdirectory, I want it going to the same exact place as the primary domain. 我不希望它转到子目录,我希望它与主域名相同。 This is just an alias for the primary domain after all. 毕竟,这只是主域的别名。

STEP 4: While I'm in there, take out those 2 comment lines I added before so that my ServerAlias is back in place for my secondary domain. 第4步:当我在那里时,取出我之前添加的那两条注释行,以便我的ServerAlias重新适用于我的辅助域。

STEP 5: Restart httpd. 第5步:重新启动httpd。

Now my secondary domain name is registered in cPanel and all the supporting data & system files to allow Apache to serve up my WordPress site properly regardless of if I go to the "charlestonvolleyball.net" or "charlestonvolleyball.com" domain. 现在,我的辅助域名在cPanel中注册,并且所有支持数据和系统文件都允许Apache正确地提供我的WordPress站点,无论我是否访问“charlestonvolleyball.net”或“charlestonvolleyball.com”域。

If you are not having an issue with this being a secondary domain name, go back and make sure all your cPanel settings are correct. 如果您没有将此作为辅助域名的问题,请返回并确保所有cPanel设置都正确无误。 You will need to make sure the domain your are trying to serve your Wordpress pages from is registered in cPanel or WHM. 您需要确保您尝试为Wordpress页面提供服务的域名是在cPanel或WHM中注册的。 In WHM it will be on your "list of accounts", assuming you are an IPP or run your own dedicated server. 在WHM中,它将在您的“帐户列表”中,假设您是IPP或运行您自己的专用服务器。

The domain can also be in cPanel for any of the domains hosted on the server and can be either the primary domain name (the main account URL) OR a parked domain. 对于服务器上托管的任何域,域也可以位于cPanel中,并且可以是主域名(主帐户URL)或停放域。 Subdomain has no bearing here, it is simply a host within a parked or primary domain. 子域名在这里没有影响,它只是停放或主域内的主机。

HTH. HTH。 Adding the parked domain and temporarily disabling my manual hacks to HTTPD worked for me. 添加停放的域并暂时禁用我的手动黑客到HTTPD为我工作。

Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM