2016-03-12 36 views
1

我試圖建立一種笨的應用程序,當我在我的XAMPP一切運行它完美的作品,但是當我的1and1在服務器上運行它,我得到一個錯誤500配置htaccess的

我與交談1and1,他們說,問題出在這個htaccess上,我不明白爲什麼?

這是文件:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 
<Files "index.php"> 
    AcceptPathInfo On 
</Files> 

php_value upload_max_filesize 100M 
php_value post_max_size 100M 
php_value max_execution_time 30 
php_value max_input_time 30 

問題出在哪裏?非常感謝

+0

檢查你的錯誤日誌。 –

+0

我看不到它們,因爲它是共享服務器,所以1and1不會看到apache日誌。 – Charly66

+1

嘗試刪除php_values,您的主機可能已禁用它們。看看它沒有它們是否有效。 –

回答

0

在你的1and1無法更改服務器的PHP規範,比如:

php_value upload_max_filesize 100M 
php_value post_max_size 100M 
php_value max_execution_time 30 
php_value max_input_time 30 

嘗試刪除此行。

此外,這是我的.htaccess文件的1and1服務器上的工作:

#Deny from all 
<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

    RewriteCond %{REQUEST_URI} ^core.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    RewriteCond %{REQUEST_URI} ^application.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    #Checks to see if the user is attempting to access a valid file, 
    #such as an image or css document, if this isn't true it sends the 
    #request to index.php 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

如果CI安裝在另一個文件夾相對的.htaccess,你應該改變RewriteBase /到/ CI-文件夾