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
From server error =>
[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'] = '';
What would i do ?
Why is this error ?
In .htaccess file of CodeIgniter_2.0.2 =>
Deny from all
virtual host for codeigniter =>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
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>
Unless you have a .htaccess
rewrite the correct URL should be http://yoursite.com/index.php/products. Notice the inclusion of the index.php and the proper domain.
My virtual Host Configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
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>
And my file .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>
It works great!! :)
精彩评论