Codeigniter+WAMP仅加载状态代码为200 OK的主页


Codeigniter + WAMP Only home page loads with status code 200 OK

WAMP对我来说一直表现得很奇怪,我不明白为什么?作为WAMP的新手,这会让事情变得更加困难。我一直在问我在Windows10上部署Codeigniter项目到WAMP设置时面临的问题。我会留下链接到我的其他帖子,这些帖子最后都没有解决,也许这些信息会帮助人们了解发生了什么。

目前的情况是,当我加载除了主页之外的本地项目(网站)的任何页面并检查firebug的网络选项卡时,它显示错误404,但该页面确实在浏览器视图中加载。虽然POST请求没有正常工作,但你可以看到我的另一个问题

怎么回事?

奇怪的行为,WAMP-码点火

WAMP Mysqli不工作,而Mysql工作

WAMP和mysqli::real_connect():(HY000/2002)?

更多信息:

Project.htaccess

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

<Files "index.php">
AcceptPathInfo On
</Files>  
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

主机文件

127.0.0.1       localhost
::1             localhost
127.0.0.1       myProject
::1             myProject

虚拟主机

<VirtualHost *:80>
    ServerAdmin contact@gmail.com
    DocumentRoot "c:/wamp/www"
    ServerName localhost
    ServerAlias localhost
    <Directory  "c:/wamp/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin contact@gmail.com
    DocumentRoot "c:/wamp/www/myProject/www"
    ServerName myProject
    ServerAlias myProject
    ErrorLog "logs/myProject-error.log"
    CustomLog "logs/myProject-access.log" common
    <Directory  "c:/wamp/www/myProject/www">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

这是一个重写问题。

在项目根目录下打开.htaccess并粘贴它:(这是一种基本配置)

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

如果有效,请根据您的需要进行定制。

希望它能起作用。

编辑:

也许你使用的链接有问题:

尝试使用:/index.php/yourController/MethodOfController

或者链接上没有index.php也是如此