0

WAMP has been behaving strangely for me and I can't figure out why ? Being new to WAMP make it much more difficult. I have been asking questions about the problems I am facing to deploy a Codeigniter project to WAMP setup on windows 10. I will leave links to my other posts which are unsolved at the end, maybe information in those will help someone understand what's going on.

The current situation is, when I load any page of the local project(website) except the homepage and check the net tab of firebug, it shows error 404, but the page does get loaded in the browser view. Although the POST request is not working like it should be, you can see my other question on it.

What's going on ?

Strange behaviour, WAMP - Codeigniter

WAMP Mysqli not working whereas Mysql works

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

Some more information :

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>

Host File

127.0.0.1       localhost
::1             localhost

127.0.0.1       myProject
::1             myProject

Virtual Host

<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>
Community
  • 1
  • 1
StudentX
  • 2,243
  • 6
  • 35
  • 67
  • 1
    Having only your home page work suggests you haven't configured the rewrites needed. I assume codeigniter needs all the requests to be redirected to `index.php` (most other php frameworks require this). It might be that. – Pavlin Dec 15 '15 at 09:07
  • _it shows error 404_ against the getting of which resources – RiggsFolly Dec 15 '15 at 09:10
  • @RiggsFolly Against the main website. Something like, url = Get Signup, status=404 Not Found, Domain=myProject, where signup is the page I am testing, url to which is http://myProject/Signup. Other resources are loading correctly. I have update my question with more information, please have a look. – StudentX Dec 15 '15 at 15:46
  • @Pavlin I have updated my question with relevent information. Please have a look if something is messed up. – StudentX Dec 15 '15 at 15:49
  • 1
    Might sound silly, but can you confirm that mod_rewrite is installed and enabled. Also try your url like http://myProject/index.php?c=site&m=login – crafter Dec 15 '15 at 16:31
  • @crafter You nailed it man. It was mod_rewrite, once I uncommented the line `LoadModule rewrite_module modules/mod_rewrite.so` it worked. Thanks – StudentX Dec 15 '15 at 18:31

1 Answers1

0

It's a rewrite problem.

Open your .htaccess at the root of your project and paste it : (It's a basic configuration)

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

If it work, customize it for your needs.

Hope it will work.

EDIT :

Maybe a problem with the link you used :

Try with : ..../index.php/yourController/MethodOfController

Or the same without index.php on the link

Solid-Snake
  • 147
  • 1
  • 2
  • 13
  • Hey, It didn't work. I have updated my question with the .htaccess I have right now for the project, please have a look. – StudentX Dec 15 '15 at 15:32