我有一个在CodeIgniter中构建的网站,它完全适用于我的本地主机,但是在将网站迁移到子域上的在线服务器时,它会提供“页面无法工作, http://sub.domain.com是无法处理request.HTTP错误500"页面无法正常工作,并返回CodeIgniter中的HTTP错误500
我也改变base_url
从localhost/school/
至sub.domain.com
,并 数据库凭据也很好。
这里是我的htaccess代码:
我有一个在CodeIgniter中构建的网站,它完全适用于我的本地主机,但是在将网站迁移到子域上的在线服务器时,它会提供“页面无法工作, http://sub.domain.com是无法处理request.HTTP错误500"页面无法正常工作,并返回CodeIgniter中的HTTP错误500
我也改变base_url
从localhost/school/
至sub.domain.com
,并 数据库凭据也很好。
这里是我的htaccess代码:
使用此RewriteEngine叙述后
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain\.com/subdomains/%1
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com
RewriteRule ^(.*)$ http://domain.com/subdomains/%1/$1 [L,NC,QSA]
为什么2个答案? –
检查你的网站的日志文件中的错误消息。 – ourmandave