从codeigniter在XAMP删除的index.php
我已经尝试了不少答案,但继续来面对良好的醇,404墙恐怖。我在Windows 7上使用XAMP堆栈。 mod_rewrite的启用。
I've tried quite a few answers but keep coming up against the good ol, 404 wall of terror. I'm on Windows 7 using a xamp stack. mod_rewrite is enabled.
我把htaccess文件中的主要codeigniter目录下,即用的应用程序,系统和user_guide目录。我应该把它的应用程序目录下呢?一个与意见/型号/配置/等。?
I put the htaccess file in the main "codeigniter" directory, that is, the directory with application, system and user_guide. Should I put it under the application directory instead? The one with the views/model/config/etc.?
下面是我目前的.htaccess文件:
Here is my current .htaccess file:
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/, use /
# If your URL is www.example.com/site_folder/, use /site_folder/
RewriteBase /website/codeigniter/
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule .* index.php/$0 [PT]
HTTP://localhost/website/$c$cigniter/index.php /欢迎工程 访问的http://本地主机/网站/ codeigniter /欢迎没有
我的config.php有
My config.php has
$config['base_url'] = 'http://localhost/website/codeigniter/';
$config['index_page'] = '';
任何帮助非常AP preciated!
Any help greatly appreciated!
该错误是:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
Error 404
更新 呵呵,就是想寻找在Apache日志,收到此错误:
UPDATE Oh, just thought about looking in apache logs, getting this error:
[Thu Mar 08 18:28:25 2012] [error] [client ::1] File does not exist: C:/xampp/htdocs/website/codeigniter/welcome
所以它似乎不被拿起正确的codeigniter重定向?不知道?
So it appears not to be picking up the proper codeigniter redirection? Not sure?
首先创建.htacess文件,并粘贴如下code在 RewriteEngine叙述上
first create .htacess file and paste below code in that RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
然后去配置文件
then go to config file
$config['index_page'] = 'index.php';
更改
$config['index_page'] = '';
和享受