PDA

View Full Version : Resolved 404 - something wrong with my script, they say...



cellshade
Feb 3rd, 2010, 05:35 PM
Hey guys.

I am not a big coder, but I thought I was doing it right.
Problem is my 404.html.

If you go on http://www.apptranslation.com and you want to access a site which is not a directory, like /123, you will see the 404.html error page.
Unfortunately, if you ad another forward slash like .com/123/456 the 404 does not show up correctly.

I called Godaddy because I thought that was a problem with the directory settings but they told me they had a look into my script and something is messed up ... weeeeelll ... great ... I have no idea :-(
Any Ideas?

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>404 @ AppTranslation.com</title>

<meta name="description" content="AppTranslation | High quality, affordable, fast translations for your mobile application" />
<meta name="keywords" content="404,page,not,found,AppTranslation.com" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="block,follow" />

<link rel="shortcut icon" type="image/x-icon" href="http://www.apptranslation.com/favicon.ico">
<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.apptranslation.com/favicon.ico"/>
<link href="stylecss/aptr.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body link="#024C5C" vlink="#024C5C" alink="#024C5C" class="oneColElsCtr">
<!-- starting css grid -->
<div id="container">
<div id="header">
<div id="tweety">
<h2><a href="http://twitter.com/apptranslation">"follow_us</a></h2>
</div>
<h1><a href="http://www.apptranslation.com">Home</a></h1>
<ul>
<li id="products"><a href="http://www.apptranslation.com/products/">AppTranslation Products</a></li>
<li id="benefits"><a href="http://www.apptranslation.com/benefits/">ApppTranslation Benefits</a></li>
<li id="references"><a href="http://www.apptranslation.com/references/">AppTranslation References</a></li>
</ul>
</div>
<div id="page404">
<div id="page_404_text">
<p>The thing is, we’ve tried looking for the page you requested on our servers, but we simply can’t find it.</p>
<p>&nbsp;</p>
<p>The good news is, we left you the main navigation bar on the top so you can access the content of the main page.</p>
<p>&nbsp;</p>
<p>AppTranslation.com</p>
</div></div>


<div id="footer">
<div id="hello">
<h7><a href="mailto:[email protected]">contact</a></h7>
</div>
<a href="http://www.apptranslation.com/impressum/">Impressum</a> | <a href="http://www.apptranslation.com/links/">Links</a> | </div>
</div><!-- closing css grid -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12593932-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

ahayzen
Feb 3rd, 2010, 05:43 PM
I have exactly the same problem on my website.
What it is, is when the 404 page is run it looks for the source files -such as images and style sheets.

This is fine when the error is in the first directory or yourdomain.com/xxx. But when there is a folder and 404 error the code can't 'find' the source files.

For example i do yourdomain.com/xx/xxx the 404 comes up looks for the images directory, /images/. But instead of going yourdomain.com/images it goes yourdomain.com/xx/images/ so it can't find the images or files.

Andy

ahayzen
Feb 3rd, 2010, 05:48 PM
To fix this error you need to get the location of the source files to be relative to the root folder not the folder in the URL. Hopefully someone else will help here.

Andy

ahayzen
Feb 3rd, 2010, 05:50 PM
Hang on i've found it. Try putting a / before your locations this should fix the error.
so href="stylecss/aptr.css"
becomes href="/stylecss/aptr.css"

cellshade
Feb 3rd, 2010, 06:38 PM
Hang on i've found it. Try putting a / before your locations this should fix the error.
so href="stylecss/aptr.css"
becomes href="/stylecss/aptr.css"


Hey buddy.. thanks for the quick solve.
Let me try it here :-)

Would be amazing if this would sort out the probs :-)
I'll let you know!

Cheers

cellshade
Feb 3rd, 2010, 06:41 PM
Hooooooooooly shi*!! How awesome is that!
Not only that you helped me out within 5 mins :-) but you've definitely solved the problem ..

Yes .. with putting a "/" before stylesheet it worked out fine :-)
Thanks again !!

Woohooo! :D