Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for File Not Found

Status
Not open for further replies.

spaulding

Technical User
Jan 10, 2001
123
US
Is there a way to check for the "404 File Not Found" error? I have a routine schedule ("schedule_normal.htm") that I want to publish one time and a few unique schedules that I publish using a "schedule_'date'.htm" format. I want to use the calendar behavior to build the file name string with the requested date. If there is a modified schedule, the script would direct them to the appropriate file. If somebody requests the file for a date with a regular schedule and I can check for the 404 error, I can redirect them to schedule_normal.htm and all is well. Can anybody help?
 
this has to be done server side
it requires you can access your webserver so you can set redirects
 
Does anybody know where a good source of information about this type server side scripting might be?
 
Actually, it's not server side scripting, it part of the server processing. If you're using apache this is done via mod-rewrite. Check out and look for mod_rewrite and the "URL Rewriting Guide".

Alternatively, you could use a cgi script in perl using the LWP module to check for the existence of the page and then print a redirect.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks

"Once more into the breech, dear friends"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top