簡體   English   中英

在子域上安裝Codeigniter,但出現500個內部服務器錯誤

[英]Installing codeigniter on subdomain but it is giving 500 internal server error

我已經安裝上類似的子域的笨http://abc.domain.com 我已經修改了我的htaccess的文件,但它給500內部錯誤。 請告訴我需要在htaccess文件中進行的更改。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /abc
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

RewriteBase更改為/ only,然后將base_url添加到您的配置文件中,例如,

# in htaccess change the RewriteBase
RewriteBase /

application/config/config.php

$config['base_url'] = 'http://abc.domain.com/';

還要確保您的htaccess文件應位於abc文件夾中,而不應位於根www

首先,我希望您已經正確配置了虛擬主機。

例如:

<VirtualHost *:80>
    ServerName abc.domain.com
    DocumentRoot /var/www/html/abc/or/whatever/
</VirtualHost>

還有您的Directory指令

<Directory /var/www/html/abc/or/whatever/>
    AllowOverride all
</Directory>

然后將其放在/var/www/html/abc/or/whatever/.htaccess文件中

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond $1 !^(index.php|images|captcha|css|js|robots.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

在大多數情況下,這應該可行。 並且不要忘記重啟apache!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM