I have this document root /var/www/example
and then inside this directory I have a file test.php
, and also my other project so the structure of the project looks like this
/var/www/example
├── .htaccess (Obs)
├── classes
├── config
├── controllers
├── public
│ ├── admin
│ │ └── index.php
│ ├── css
│ ├── index.php
│ └── js
├── test.php (Obs! not managed by .htaccess)
└── views
.htaccess
Options +FollowSymLinks
AddDefaultCharset UTF-8
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^admin[/]?$ /example/admin/login [redirect]
RewriteRule ^admin/([a-zA-Z]+)/?([a-zA-Z0-9/]*)$ public/admin/index.php?page=$1&query=$2 [L]
RewriteRule ^([a-zA-Z]+)/?([a-zA-Z0-9/]*)$ public/index.php?page=$1&query=$2 [L]
I recently moved the project from a MAMP server running on localhost to a domain-driven server. When I try my
test.php
file it works and echo "It works"
as intendended but when I try running my site it doesn´t .
error.log
[Mon Jul 29 18:02:52 2013] [error] [client 83.248.93.217] script '/var/www/example/index.php' not found or unable to stat
[Mon Jul 29 18:02:52 2013] [error] [client 83.248.93.217] File does not exist: /var/www/favicon.ico
[Mon Jul 29 18:03:02 2013] [error] [client 83.248.93.217] File does not exist: /var/www/example/bordsoversikt
[Mon Jul 29 18:03:02 2013] [error] [client 83.248.93.217] File does not exist: /var/www/favicon.ico
My controller maps some of the sites by names to corresponding files like so
content of client_router all calls goes through index.php as htaccess
and then to the router...
public function initialize_routes() {
$this->routes = array(
"bordsoversikt" => "page_table_overview",
"bordsreservation" => "page_table_reservation",
"reservationsprocess" => "script_reserve_form",
"registrering" => "page_registration",
"registreringsprocess" => "script_register_form",
"lyckadregistrering" => "page_successfull_signup",
"login" => "page_login",
"logout" => "script_logout",
"profil" => "page_home",
"klientlogin" => "script_login",
"profil" => "page_profile",
"sparaprofil" => "script_edit_profile_changes"
);
I assume there could be something wrong either with my htaccess file, why i posted the contents, or there could be something wrong with my apache2.config
file. But Im quite new on configuring apache so I wont try to post parts of it, as I probably would post the uncritical parts. Can somebody please help me. Thanks