Getting 404 Errors on Server

I am trying to install someone’s github project who used Yii. I am getting 404 not found errors and need help fixing it.

My index.php comes up fine when I go here:

mydomain.com

But any urls in subdirectories fail with a 404 not found error.

For instance mydomain.com/stats gives the 404 error.

I am using lighttpd and php7. I don’t see anything in the logs for either of those two programs.

Structure is like this:

My root is:

/var/yaamp/web/

The index.php lives there.

Then I have subdirectories called

[b]/var/yaamp/web/assets

/var/yaamp/web/extensions

/var/yaamp/web/framework

/var/yaamp/web/images

/var/yaamp/web/yaamp[/b]

For the most part I think directly referencing files as they are in the directory structure works fine.

I can do mydomain.com/yaamp/modules/stats/test.php

or mydomain.com/images/41.png

But the original developer has lots of links that don’t explicitly exist in the structure

so I’m not sure why it isn’t working.

For instance mydomain.com/stats probably is referring to a file called

/var/yaamp/web/yaamp/modules/stats/index.php

I do get an error 500 when I try it like this:

mydomain.com/yaamp/modules/stats/index.php

also in that folder is a file that may be important called StatsController.php

The relevant section of my lighttpd.conf looks like this:

[b]$HTTP["host"] =~ "mydomain.com" {

    server.document-root = "/var/yaamp/web"


    url.rewrite-if-not-file = (


	"^(.*)/([0-9]+)$" => "index.php?r=$1&id=$2",


	"^(.*)\?(.*)" => "index.php?r=$1&$2",


            "^(.*)" => "index.php?r=$1",


            "." => "index.php"


    )


url.access-deny = ( "~", ".dat", ".log" )

}[/b]

If anyone is interested the Github repo I am trying to get working is here: github.com/tpruvot/yiimp

I just don’t know what to do next. Please help!

[color="#006400"]/* Moved from "2.0" to "1.1.x" */[/color]

The project globalzon/yaamp (https://github.com/globalzon/yaamp) which you forked is built on Yii 1.1.x, and your yiimp project also uses Yii 1.1.x.

IMO, the first thing you have to do is to read the Guide. (http://www.yiiframework.com/doc/guide/)

At the very least you have to read through the first 2 sections of it: “Getting Started” and “Fundamentals”. Without the basic knowledge of the framework it’s impossible for you to do something with it.

I am trying to install someone’s github project who used Yii. I am getting 404 not found errors and need help fixing it.

My index.php comes up fine.

mydomain.com/

But any urls in subdirectories fail with a 404 not found error.

For instance mydomain.com/stats

I am using lighttpd and php7. I don’t see anything in the logs

for either of those two programs.

Structure is like this:

My root is:

/var/yaamp/web/

The index.php lives there.

Then I have subdirectories called

[b]/var/yaamp/web/assets

/var/yaamp/web/extensions

/var/yaamp/web/framework

/var/yaamp/web/images

/var/yaamp/web/yaamp[/b]

For the most part I think directly referencing files as they are in the directory structure works fine.

I can do mydomain.com/yaamp/modules/stats/test.php

or mydomain.com/images/41.png

But the original developer has lots of links that don’t explicitly exist in the structure

so I’m not sure why it isn’t working.

For instance mydomain.com/stats probably is referring to a file called

/var/yaamp/web/yaamp/modules/stats/index.php

I get an error 500 when I try it like this:

mydomain.com/yaamp/modules/stats/index.php

also in that folder is a file that may be important called StatsController.php

The relevant section of my lighttpd.conf looks like this:

[b]$HTTP["host"] =~ "mydomain.com" {

    server.document-root = "/var/yaamp/web"


    url.rewrite-if-not-file = (


	"^(.*)/([0-9]+)$" => "index.php?r=$1&id=$2",


	"^(.*)\?(.*)" => "index.php?r=$1&$2",


            "^(.*)" => "index.php?r=$1",


            "." => "index.php"


    )


url.access-deny = ( "~", ".dat", ".log" )

}[/b]

I just don’t know what to do next. Please help!

It seem to me that your lighttpd URL rewrite is not working properly

Yii uses URL rewrite to manage URL in a single entrance point.

These URL are managed by yii routing system that execute a module and/or a controller and action.

When URL rewrite is properly configured all your URL should be like

Http://mysite.com/<controller>/<action>

Are you sure you are using lighttpd? Since log is empty maybe you have another webserver active.

[color="#006400"]/* topics merged */[/color]