All of the pages are showing '404 not found'

Hi there!
Recently I migrated my project to another wamp environment (both of them are wamp server2.5).
In my new environment, I can see my top page perfectly. But I got a ‘404 not found’ when I clicked any link on my top page.

my top page:

The 404 not found:

my PHP error log:

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP Notice:  Undefined offset: 0 in E:\projects\haigui\view\default\home.php on line 110

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP Stack trace:

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP   1. {main}() E:\projects\haigui\index.php:0

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP   2. require() E:\projects\haigui\index.php:153

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP   3. include() E:\projects\haigui\controller\home.php:67

[25-Dec-2020 11:43:20 Asia/Shanghai] PHP   4. include() E:\projects\haigui\view\default\layout.php:268

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP Notice:  Undefined offset: 0 in E:\projects\haigui\view\default\home.php on line 110

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP Stack trace:

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP   1. {main}() E:\projects\haigui\index.php:0

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP   2. require() E:\projects\haigui\index.php:153

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP   3. include() E:\projects\haigui\controller\home.php:67

[25-Dec-2020 11:43:55 Asia/Shanghai] PHP   4. include() E:\projects\haigui\view\default\layout.php:268

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP Notice:  Undefined offset: 0 in E:\projects\haigui\view\default\home.php on line 110

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP Stack trace:

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP   1. {main}() E:\projects\haigui\index.php:0

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP   2. require() E:\projects\haigui\index.php:153

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP   3. include() E:\projects\haigui\controller\home.php:67

[25-Dec-2020 13:04:17 Asia/Shanghai] PHP   4. include() E:\projects\haigui\view\default\layout.php:268

The ‘E:\projects\haigui\view\default\home.php on line 110’

How to fix this problem?

There can be multiple problems that cause this. Do you have an .htaccess file in the root directory of this project that might do url rewriting? Do all the pages that you call on actually exist in the site structure at the exact same file location you are trying to specify? If you are running this locally using Apache, do you have any kind of configuration in httpd-vhosts.conf that might be wrong?

I would double check that the files exist exactly at the locations you expect them to be and then go to look at configs and look for things like URL rewriting.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.