当我的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
答案 0 :(得分:3)
1)将代码片段添加到wp-config.php,在多站点创建后,它们在框中显示的内容。
2)使用给定的代码片段更新htaccess。
3)从' LoadModule rewrite_module modules / mod_rewrite.so'的开头删除#符号。在apache服务器配置文件的httpd.conf中保存文件,重启wamp服务器
答案 1 :(得分: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]
所以我只是用适当的换行符编辑它。