子域

2014-01-29 54 views
0

面臨htaccess的問題,我創建了一個子域,但是當我在瀏覽器中訪問過它的給予500內部服務器錯誤。子域

子域:sub.domain.com 目錄:/子

下面是關於htaccess文件/:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase/
RewriteRule ^$ app/webroot/ [L] 
RewriteRule (.*) app/webroot/$1 [L] 

RewriteCond %{HTTP_HOST} ^domain\.com [NC] 
RewriteRule (.*) http://www.domain.com/ [L,R=301] 
</IfModule> 

我需要在我的htaccesss文件添加任何東西,使其工作。

更新:----------------------------------

另外我的主域名工作好,沒有問題。

<IfModule mod_rewrite.c> 
RewriteEngine On 

# NOTE: change this to your actual StatusNet base URL path, 
# minus the domain part: 
# 
    http://sub.domain.com/  =>/
    http://sub.domain.com/mublog/ => /mublog/ 
# 
RewriteBase /mublog/ 

## Uncomment these if having trouble with API authentication 
## when PHP is running in CGI or FastCGI mode. 
# 
#RewriteCond %{HTTP:Authorization} ^(.*) 
#RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule (.*) index.php?p=$1 [L,QSA] 
</IfModule> 

<FilesMatch "\.(ini)"> 
Order allow,deny 
</FilesMatch> 

回答

0

試着改變你的規則順序:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase/

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301] 

RewriteRule !^app/webroot/ app/webroot%{REQUEST_URI} [L,NC] 

</IfModule> 
+0

好吧,讓我來試試這個,謝謝。 –

+0

不,它不能工作 –

+0

如果你仍然得到子域名500,然後發佈子域的.htaccess。 – anubhava