1

当我的 htaccess 是这样时,我的 wesbite yofnel.com 是可以查看的

# END WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

但是如果我删除

# END WordPress

它不再起作用了。并给我这个错误

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@yofnel.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

请帮忙,我对设置我的多站点感到沮丧。

这是我在错误日志中发现的错误。

[Tue May 14 11:36:38 2013] [alert] [client 67.159.36.27] /home/yofnel/public_html/.htaccess: RewriteEngine must be On or Off
4

2 回答 2

3

1)将代码片段添加到 wp-config.php 中,它们在多站点创建后显示在框中。

2) 使用给定的代码片段更新 htaccess。

3)去掉apache服务器配置文件httpd.conf中'LoadModule rewrite_module modules/mod_rewrite.so'开头的#符号保存文件,重启wamp服务器

于 2014-07-18T12:25:43.317 回答
2

Nvm htaccess 现在正在工作。

我检查了 cpanel 文件管理器,发现上传的 htaccess 文件排列不正确。

我使用 ftp 来编辑 htaccess,我在 cpanel 上看到了这个

RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]# add a trailing slash to /wp-adminRewriteRule ^wp-admin$ wp-admin/ [R=301,L]RewriteCond %{REQUEST_FILENAME} -f [OR]RewriteCond %{REQUEST_FILENAME} -dRewriteRule ^ - [L]RewriteRule ^(wp-(content|admin|includes).*) $1 [L]RewriteRule ^(.*\.php)$ $1 [L]RewriteRule . index.php [L]

所以我只是用正确的换行符编辑它。

于 2013-05-14T16:29:35.457 回答