2011-08-29 56 views
1

http://mysite/products/create笨錯誤,文件不存在

Not Found 

The requested URL /products/create was not found on this server. 
Apache/2.2.16 (Debian) Server at site5.example.com Port 80 

從服務器錯誤=>

[Sun Aug 28 23:51:45 2011] [error] [client 127.0.0.1] File does not exist: /var/www/CodeIgniter_2.0.2/products 

routes.php文件=>

$route['default_controller'] = 'products'; 
$route['404_override'] = ''; 

我會怎麼做?

爲什麼會出現此錯誤?

在對笨=>

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName mysite.com 

    DocumentRoot /var/www/CodeIgniter_2.0.2 

    <Directory /var/www/CodeIgniter_2.0.2> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Order allow,deny 
     allow from all 
    </Directory> 

</VirtualHost> 

回答

4

CodeIgniter_2.0.2 =>

Deny from all 

虛擬主機的.htaccess文件,除非你有一個.htaccess重寫正確的URL應該是http://yoursite.com/index.php/products。注意包含index.php和適當的域。

+0

你是什麼意思.htaccess重寫?我編輯了原始問題帖子。看到了。 – shibly

0

我的虛擬主機配置:

<VirtualHost *:80> 
     ServerAdmin [email protected] 
     ServerName mysite.com 

     DocumentRoot /var/www/CodeIgniter_2.0.2 

     <Directory /var/www/CodeIgniter_2.0.2> 
      Options Indexes FollowSymLinks 
      AllowOverride All 
      Order allow,deny 
      allow from all 
     </Directory> 

    </VirtualHost> 

我的文件的.htaccess:

<ifModule mod_rewrite.c>                               
     RewriteEngine On                                
     RewriteCond %{HTTP_HOST} ^IP$ [NC]                          
     RewriteCond %(REQUEST_FILENAME) !-f                            
     RewriteCond %(REQUEST_FILENAME) !-d                            
     RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)                       
     RewriteRule ^(.*)$ ./index.php/$1 [L]                           
    </ifModule>                                   
    <ifModule !mod_rewrite.c>                               
     ErrorDocument 404 /IP/CodeIgniter_2.0.2/index.php                       
    </ifModule>  

它的偉大工程! :)