Link to home
Start Free TrialLog in
Avatar of gosox18
gosox18

asked on

NOT FOUND The requested URL was not found on this server.

I have a website that i can access and browse via localhost or remotely using the host ip. when i access the site using the domain url, i can get to the login page and the main page without difficulty. on trying any on the links on the main page, i get the error: NOT FOUND The requested URL xxxxx.php was not found on this server.

php5 - apache 2.0
Avatar of fosiul01
fosiul01
Flag of United Kingdom of Great Britain and Northern Ireland image

so You saying

when you browse the server via localhost or Host Ip
everything is fine

but when you browese

http://yourdomain.com

then you dont get any linl
is that right ??

is this windows server or linux server ??

have you checked the error log ??
Avatar of Ionut A. Tudor
The domain is the same ? sometimes www.example.com has different content from example.com and the www subdomain could have other directory where it gets the files from. Be sure your links point to the same subdomain on that domain.
Avatar of gosox18
gosox18

ASKER

when i browse us http://mydomain.com i get to login page and then to homepage. any links in homepage result in the error.

apache 2.0 and php 5
Avatar of gosox18

ASKER

i checked that the paths for both the localhost/directory and the domain name virtual directory are the same
can you post a link to your website ?
Avatar of gosox18

ASKER

i cannot post the link - the site is internal - i have local dns set up for the url.
Can you read the file access.log ? Post few lines after you replicate the behaviour on your website
Avatar of gosox18

ASKER

al3cs12 - thanks for sticking with me. i don't know anything about an access.log and a search of the machine produces none.
what's your OS ?
Avatar of gosox18

ASKER

centos 5
/var/log/httpd/access_log
see the last lines in there and post them here
You could also check the location of access logs in httpd.conf directive
CustomLog /path/here
Avatar of gosox18

ASKER

ah - ok was look for access.log instead of access_log. here are the last few lines:

192.168.1.32 - - [26/Feb/2009:12:43:31 -0500] "GET / HTTP/1.1" 200 10783 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"
192.168.1.32 - - [26/Feb/2009:12:43:31 -0500] "GET /logo.jpg HTTP/1.1" 304 - "http://www.fhs-employees.org/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"
192.168.1.32 - - [26/Feb/2009:12:43:31 -0500] "GET /bu8k.jpg HTTP/1.1" 304 - "http://www.fhs-employees.org/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"
192.168.1.32 - - [26/Feb/2009:12:43:33 -0500] "GET /Employee/directoryhome.php HTTP/1.1" 404 310 "http://www.fhs-employees.org/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)"
Avatar of gosox18

ASKER

www
Look in your vhosts configurations where the document root path of the www subdomain is and change it to your wanted path.
ASKER CERTIFIED SOLUTION
Avatar of Ionut A. Tudor
Ionut A. Tudor
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gosox18

ASKER

yup - spent a lot of time doing that already. i'll go back and do it again. this stuff is often something as insignificant as a misplaced comma. thanks for the help.
The error_log should show you the physical path the request "/Employee/directoryhome.php" was mapped to, i.e., where apache tries to look for Employee/directoryhome.php.
Avatar of gosox18

ASKER

it seems i'm not writing errors to error_log - at least for this particular website as I can see errors for other sites on the same machine. in any case, what i can't figure out is this:
this site works perfectly fine if accessed as follows:
http://localhost/Employee - or from another machine
http://ip-address/Employee

however, when i access this site via url (as in http://website) i get to main.php where i login and it brings me to the homepage.htm. when i click on any link on this page, i get the error NOT FOUND blah,blah.

so it seems its not a matter of finding the site, but the internal navigation changes depending on how i access the site.
Your login file redirects you to www.your-website.com and from there the html automaticaly changes the link to www.your-website.com/otherfile.html so the problem is that you need to find the DocumentRoot for the subdomains and make it to match with the main configuration files, search apache conf files for vhosts and change it. Are you using a control panel to set the subdomains ?
Avatar of gosox18

ASKER

sorry if i've confused matters. the links are not to sub domains - they are pages within the site.

see if this makes sense:
x.x.x.x/Employee brings me to the site and works fine
domain brings me to the site, but navigating within does not work. in httpd.conf i have the virtual host configured to path /var/www/html/Employee. when i log in using domain name and hover over a link it displays http://domain/Employee/pagename.php. since the domain already maps to /Employee in httpd.conf, then isn't http://domain/Employee redundant?

not sure where this leads.
yes change /var/www/html/Employee to /var/www/html/ and it should work after that
Avatar of gosox18

ASKER

actually, i need the path as it is in httpd.conf. otherwise, the browser will not make it to the site. what i am going to do, and just experimented with, is to change the calls in my pages to reduce the path.

thanks much for helping me walk through this - i was completely stuck. i'm rather new to linux - it helps to have more expert input.
Avatar of gosox18

ASKER

this recommendation caused me to more closely scrutinize all of the associated paths. Indeed, there were some paths that needed modification. All works weel now.