473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

custom SHTML 404

I've made some basic customer error messages to display to the user if
they type the URL in wrong and its works fine for bad URLS of the form

www.google.com/bad.htm

Problem is if the bad URL they type has an several addional folder on
it i.e.

www.google.com/foo/bar/bad.htm

Then my custom 404 error cannot display the website logo at the top
because its looking in the ../images folder but Im thinking it would
then have to be ../../images?

But I cant change the code to ../../images because then

www.google.com/bad.htm

wouldnt load the pictures instead.

Is there a way ensure my logo is at the top regardless of how many
subfolders the user tries to type?
Jul 20 '05 #1
2 2035
David wrote:

[snip]
Is there a way ensure my logo is at the top regardless of how many
subfolders the user tries to type?


Yes, refer to the images relative to the root:

<img src="/images/..."...

--
Jim Dabell

Jul 20 '05 #2
David wrote:
customer error messages to display to the user if they type the URL
in wrong and its works fine for bad URLS of the form
www.google.com/bad.htm
Best to use example.com for examples like this.
www.example.com/bad.htm
if the bad URL they type has an several addional folder on it i.e.
www.google.com/foo/bar/bad.htm

Then my custom 404 error cannot display the website logo at the top
because its looking in the ../images

But I cant change the code to ../../images because then
www.google.com/bad.htm wouldnt load the pictures

Is there a way ensure my logo is at the top
Well, you can make sure that the logo image file can be found, at any
rate.
regardless of how many subfolders the user tries to type?


2 choices:

(1) follow Jim Dabell's advice (use src="/images/foo.gif" instead of
src="../images/foo.gif")

(2) use the base href in the error documents so that, no matter which
directory produces a 404error.html document, the relative urls resolve
to the same file.

I'd recommend (2) even if you also do (1), since using base href also
allows you to put links on the error page so that visitors who get an
error can easily go to other resources on your site.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike K. | last post by:
When I renamed my files with an shtml extension the design option disappeared and the html code lost its color- coding. Does anyone know how to setup the environment so that it treats .shtml file...
1
by: Lee | last post by:
When my application reads my custom error log with VB.NET the entry reads simiar to the one below, but when it receives the EntryWritten event, the Text is correct. How do I fix this The message...
10
by: EnjoyNews | last post by:
I have a php site I have an include line called "include 'Cookie.php';" In this Cookie.php file I have these codes. <?php $conn = mysql_connect("$db", "$user", "$pass");...
4
by: Wiktor Zychla | last post by:
Hello, for some reason I need to use attributes in ILAsm code and read these attributes in C# code. My problem is with the attribute declaration inside ILAsm code. I know that I define any...
16
by: Patty O'Dors | last post by:
In my quest to create a derived edit control in ATL that will go into an application that will hopefully make me some money one day, I have decided to try to devise a custom licensing scheme for...
1
by: vighnesh | last post by:
Hi All I am presently working in a project(VB.NET/C#.NET) in which I have to add a custom toolbar to the "Internet Explorer". Can anyone please help me in this regard?Thank you in advance. ...
3
by: Clint | last post by:
Hi, I am trying to implement the custom paging in the datalist in this format: << Prev 1,2,3,4,5 Next >>. Does anyone knows how to do this. Thanks in advance. Clint
14
by: Scott M. | last post by:
How do I add information to a custom class's properties and methods so that when an instance of the class is made the VS.NET intelliSense will show the information in a tooltip as the members are...
8
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I want to create a custom form border. By thought was to simply override the DisplayRectangle property in order to control the border width and then draw the border during the OnPaint event. The...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.