404 error URL not matching href URL

Status
Not open for further replies.

donsno278

New Member
Messages
12
Reaction score
0
Points
1
All but one of my internal links are working fine, but one is throwing a 404 error and the URL it says was not found is not the URL I'm trying to link to. I have changed both the href URL and the name of the target index.file several times but the 404 always reflects a different URL than I'm trying to link to. I can't find any other instances of the html file I'm trying to link from. It charts like this:

404 "alpha.html is not found" This is consistent and wrong
calling file "<a href="beta.html> etc. or
calling file "<a href="gamma/beta.html> etc depending if the target is in a subfolder or not
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Sounds like an .htaccess mod_rewrite problem.

Without a link to the page in question, it is hard to tell.
 

donsno278

New Member
Messages
12
Reaction score
0
Points
1
Sounds like an .htaccess mod_rewrite problem.

Without a link to the page in question, it is hard to tell.

The domain is donsfamily.x10.mx; /public_html/trees/ is the link to the problem area. I hope this is what you need.
I should have added earlier that this link was working error free until I updated the target index.file a couple of days ago.
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Can I have the exact steps to reproduce the error? I don't see any 'index.file' under /trees/.
 

donsno278

New Member
Messages
12
Reaction score
0
Points
1
Thanks for the comeback, Brandon. I've reset the coding to simplify--I had left it as it was when I quit trying different alternatives.
From public_html: /trees/trees.html; near the bottom of that page is "<a href="folder_one/index.html" which should open a family tree display. Ignore the second line there; I'll fix that when I find out how. ;-)

For me, that top line throws up a 404 "Not Found
The requested URL /folder_one/index.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request". Even if I change the folder and index file names for testing, the 404 message never changes to match the different names.

I hope that's enough of a clue that you can point me to the problem and a solution.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. that link points to 'index page.html' ... with a space, which is bad. URLs should not have spaces in them.
2. that link works
3. the name of the index page should be index.html . If you go to /trees/folder_one you see a list of all your files, which is not standard practice.
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
in folder_one/ there is no index.html, there is however one "index page.html" if you rename that file to index.html (assuming that one holds the content you are after) it should work.

folders/files need to be referenced with their exact name, even case matters here, and generally you should not have spaces in your files/folders name when dealing with internet.
 

donsno278

New Member
Messages
12
Reaction score
0
Points
1
Descalzo, Anna - thanks for the quick responses. The program that compiled the target web page named it with a space, but I tried several other names with no space, and never got it to work. I have just renamed the target file "index.html", gone to the website in both Opera 11 and MSIE 8, and neither one will open that link. All the "404" messages are driving me crazy! :) That same file with the original name "index page.html" opens fine on my own machine, but not on my web page. There's got to be a trick to it somewhere. :)
 

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
Try clearing your browser cache, I had to do that before the link on trees.html actually became the right one, when I loaded up the page it did show as linking to "index page.html", after clearing my browser cache (or rather doing a forced reload by hitting ctrl+f5) it showed the correct link, and clicking it worked fine.
 

donsno278

New Member
Messages
12
Reaction score
0
Points
1
Thanks, Anna. Nope, not even that works. How are you testing the link? I can only get there by logging into my page with its password (which has been working for weeks now), navigating to the right sub-page, and following menus, but every time I get the same result. Insane, right? Would your tests spot a corrupt file? I'm starting to wonder about that, since the problem only started when I updated that target index.file a few days ago, but the new file still works fine on my own system. Weird!
 
Last edited:

Anna

I am just me
Staff member
Messages
11,752
Reaction score
582
Points
113
I'm browsing it, you'll want to check up on your security, because entering the full url to the trees.html page bypasses the password restriction.

Although, it looks like you changed the links at the bottom of that page again. The first link works, but not the second when I check now, neither use /folder_one/index.html as target path.

If you set the link path like "/path_to/file.html" the server will treat that as being an "absolute path starting at the domain root" which is interpertated as http://mydomain.x10.mx/path_to/file.html regardless of what folder the document you add that link to is located.
While doing the link as "path_to/file.html" would come up as http://mydomain.com/[location]/path_to/file.html where [location] represents the path that the file containing the link is located, in your case the trees folder.

Do note that windows and linux may handle things a little different in these cases, so if your system is windows that could account for things working there but not on the server.
 

donsno278

New Member
Messages
12
Reaction score
0
Points
1
Anna, Descalzo, and Brandon

Thanks to all three of you. I had to do other things a couple of days, but I think I've got the problem solved. I'd like to think it's my ingenuity, but it was probably pure luck. I needed to move one html file up one level and adjust the path, and all is working well now. To be specific, I had trees.html in a folder /trees/; when I raised it up to /public_html/ and verified the new path my troubles were gone.

I appreciate the patience and the suggestions. I guess this thread can be closed now. Bye
 
Last edited:
Status
Not open for further replies.
Top