.htaccess 文件破坏了我的 WP 网站
我添加的只是服务器授权。我是在我在那里找到的现有 WordPress .htaccess 内容之上完成的。
顺便说一句,授权有效,非常棒。但现在我收到“500 Internal Server”错误。我是 WP 新手,我假设这个 .htaccess 文件是安装时的标准配置。也许这只是一些显而易见的事情,由于某种原因我看不到?
Order deny,allow
Deny from all
AuthType Basic
AuthUserFile .htpasswd
AuthName "PROTECTED ZONE"
require valid-user
Satisfy Any
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /devip/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /devip/index.php [L]
</IfModule>
All I added was server authorization. I did it on top of the existing WordPress .htaccess stuff I found in there.
The authorization works, great, btw. But now I get a "500 Internal Server" error. I'm new to WP and I'm assuming this .htaccess file came standard with the install. Perhaps it's just something obvious I can't see for some reason?
Order deny,allow
Deny from all
AuthType Basic
AuthUserFile .htpasswd
AuthName "PROTECTED ZONE"
require valid-user
Satisfy Any
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /devip/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /devip/index.php [L]
</IfModule>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你能查看你的apache error.log吗?内部服务器错误应该记录在那里。 htaccess 文件中可能存在一些小错误。
Can you view your apache error.log? internal server errors should be logged in there. Probably some little error in the htaccess file.
文件
.htpasswd
是否存在?它是相对于ServerRoot
进行搜索的。Apache 手册:
我的猜测是它不在服务器上的
ServerRoot
目录中。请检查它并根据需要更正路径。Does the file
.htpasswd
exist? It is searched relative to theServerRoot
.Apache manual:
My guess is that it's not sitting in the
ServerRoot
directory on your server. Please check it and correct the path if needed.500 服务器错误有时与 .htaccess 文件的字符编码有关。当我第一次开始使用 WordPress 和 .htaccess 文件时,我犯了这个错误。
您使用哪种文本编辑器来编辑 .htaccess?对于 Windows PC,您应该使用记事本并保存为纯文本。在 Mac 上,使用 TextEdit 并另存为纯文本。或者使用 GoDaddys 的文件管理器打开并保存文件。
500 Server errors sometimes have to do with the character encoding of the .htaccess file. I made that mistake when I first started working with WordPress and .htaccess files.
What kind of text editor did you use to edit .htaccess? With a Windows PC, you should use Notepad and save as plain text. On a Mac, use TextEdit and save as plain text. Or use GoDaddys's file manager and open and save the file.