Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

404 Question Part 2

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  DNS  
Author Message
user135

External


Since: Jul 14, 2003
Posts: 15



(Msg. 1) Posted: Wed Oct 01, 2003 2:42 am
Post subject: 404 Question Part 2
Archived from groups: alt>www>webmaster (more info?)

The last thread kind of went off on a tangent, so I'll pose the question
below again. This is not to mess up the search engines because none of the
404 pages are linked to one another. Instead, I just want to give the user
the appearance that the page he requested is still up and running and not
give him the appearance of a broken link.

So I kindly ask again, is there a way to have some code that if someone goes
to a page that is a
404, it runs an SSI.

As an example, if someone went to the webpage www.url.com/test1.shtml, the
404 would load the following:

<!--#include virtual="page.cgi?test1.shtml" -->

On the other hand, if someone went to the webpage www.url.com/test2.shtml,
the 404 would load the following:

<!--#include virtual="page.cgi?test2.shtml" -->

Thanks

 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
grocer

External


Since: Sep 26, 2003
Posts: 25



(Msg. 2) Posted: Wed Oct 01, 2003 3:05 am
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Perhaps it was merely implied in the previous thread, but the answer is yes.
Create your 404 page as ASP, CGI or whatever you want to write it in, and do
whatever you like: in your case, redirect to page.cgi with the requested URL
as argument. 'Include' is maybe not the simplest way to do it, but it would
work.

If you want sample code, do a Google for 'smart' error404 pages: there are
examples on all the web page code sites I've looked at.


"(a)" <nospam.RemoveThis@spam.com> wrote in message
news:Vxoeb.40954$O85.34210@pd7tw1no...
 > The last thread kind of went off on a tangent, so I'll pose the question
 > below again. This is not to mess up the search engines because none of
the
 > 404 pages are linked to one another. Instead, I just want to give the
user
 > the appearance that the page he requested is still up and running and not
 > give him the appearance of a broken link.
 >
 > So I kindly ask again, is there a way to have some code that if someone
goes
 > to a page that is a
 > 404, it runs an SSI.
 >
 > As an example, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test1.shtml," target="_blank">www.url.com/test1.shtml,</a> the
 > 404 would load the following:
 >
 > <!--#include virtual="page.cgi?test1.shtml" -->
 >
<font color=purple> > On the other hand, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test2.shtml,</font" target="_blank">www.url.com/test2.shtml,</font</a>>
 > the 404 would load the following:
 >
 > <!--#include virtual="page.cgi?test2.shtml" -->
 >
 > Thanks
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
user135

External


Since: Jul 14, 2003
Posts: 15



(Msg. 3) Posted: Wed Oct 01, 2003 3:30 am
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks, I think that is the most helpful someone has been regarding this
thread, I will search for smart error 404 pages.

This is what I tried in my htaccess file, but it didn't work

ErrorDocument 404 <!--# include
virtual="http://www.url.com/beta/page.cgi?&&HTTP_REFERER&&"-->
I was hoping as an example, if someone types in
<a style='text-decoration: underline;' href="http://www.someurl.com/beta/jdhdghsu.htm" target="_blank">http://www.someurl.com/beta/jdhdghsu.htm</a> and that page didn't exist, they
would go to <a style='text-decoration: underline;' href="http://www.someurl.com/beta/page.cgi?jdhdghsu.htm" target="_blank">http://www.someurl.com/beta/page.cgi?jdhdghsu.htm</a>

I'll see if I can find some information on the smart error 404 pages.





"Jezebel" <grocer.RemoveThis@play.net> wrote in message
news:NSoeb.130937$bo1.9511@news-server.bigpond.net.au...
 > Perhaps it was merely implied in the previous thread, but the answer is
yes.
 > Create your 404 page as ASP, CGI or whatever you want to write it in, and
do
 > whatever you like: in your case, redirect to page.cgi with the requested
URL
 > as argument. 'Include' is maybe not the simplest way to do it, but it
would
 > work.
 >
 > If you want sample code, do a Google for 'smart' error404 pages: there are
 > examples on all the web page code sites I've looked at.
 >
 >
 > "(a)" <nospam.RemoveThis@spam.com> wrote in message
 > news:Vxoeb.40954$O85.34210@pd7tw1no...
  > > The last thread kind of went off on a tangent, so I'll pose the question
  > > below again. This is not to mess up the search engines because none of
 > the
  > > 404 pages are linked to one another. Instead, I just want to give the
 > user
  > > the appearance that the page he requested is still up and running and
not
  > > give him the appearance of a broken link.
  > >
  > > So I kindly ask again, is there a way to have some code that if someone
 > goes
  > > to a page that is a
  > > 404, it runs an SSI.
  > >
<font color=green>  > > As an example, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test1.shtml,</font" target="_blank">www.url.com/test1.shtml,</font</a>>
the
  > > 404 would load the following:
  > >
  > > <!--#include virtual="page.cgi?test1.shtml" -->
  > >
  > > On the other hand, if someone went to the webpage
<a style='text-decoration: underline;' href="http://www.url.com/test2.shtml," target="_blank">www.url.com/test2.shtml,</a>
  > > the 404 would load the following:
  > >
  > > <!--#include virtual="page.cgi?test2.shtml" -->
  > >
  > > Thanks
  > >
  > >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
sp_bhuisman

External


Since: Jun 27, 2003
Posts: 571



(Msg. 4) Posted: Wed Oct 01, 2003 11:58 am
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 01 Oct 2003 00:30:38 GMT, (a) <nospam.DeleteThis@spam.com> wrote:

 > Thanks, I think that is the most helpful someone has been regarding this
 > thread, I will search for smart error 404 pages.
 >
 > This is what I tried in my htaccess file, but it didn't work
 >
 > ErrorDocument 404 <!--# include
 > virtual="http://www.url.com/beta/page.cgi?&&HTTP_REFERER&&"-->
 > I was hoping as an example, if someone types in
 > <a style='text-decoration: underline;' href="http://www.someurl.com/beta/jdhdghsu.htm" target="_blank">http://www.someurl.com/beta/jdhdghsu.htm</a> and that page didn't exist, they
<font color=purple> > would go to <a style='text-decoration: underline;' href="http://www.someurl.com/beta/page.cgi?jdhdghsu.htm</font" target="_blank">http://www.someurl.com/beta/page.cgi?jdhdghsu.htm</font</a>>
 >
 > I'll see if I can find some information on the smart error 404 pages.

Just put in your .htaccess file:

ErrorDocument 404 404.shtml

.... and then put all that include crap in the 404.shtml page Smile This will
send the 404 and also allow you to pick up where the error left off. The
&&REQUEST_URI&& variable will hold the path and page the user was trying
to get to.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca RingMaker: PHP web ring creation and
management<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
davidvb2

External


Since: Sep 25, 2003
Posts: 106



(Msg. 5) Posted: Wed Oct 01, 2003 5:02 pm
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

(a) wrote:

 > The last thread kind of went off on a tangent, so I'll pose the question
 > below again. This is not to mess up the search engines because none of the
 > 404 pages are linked to one another. Instead, I just want to give the user
 > the appearance that the page he requested is still up and running and not
 > give him the appearance of a broken link.
 >
 > So I kindly ask again, is there a way to have some code that if someone goes
 > to a page that is a
 > 404, it runs an SSI.
 >
 > As an example, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test1.shtml," target="_blank">www.url.com/test1.shtml,</a> the
 > 404 would load the following:
 >
 > <!--#include virtual="page.cgi?test1.shtml" -->
 >
<font color=purple> > On the other hand, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test2.shtml,</font" target="_blank">www.url.com/test2.shtml,</font</a>>
 > the 404 would load the following:
 >
 > <!--#include virtual="page.cgi?test2.shtml" -->
Make this your error document:

<?php
echo "<!--#include virtual=\"page.cgi?" .
substr($_SERVER['REQUEST_URI'], 1) . "\" -->";
?>

.... should give you want you need.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
user135

External


Since: Jul 14, 2003
Posts: 15



(Msg. 6) Posted: Thu Oct 02, 2003 7:03 am
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the code. The only thing is that it changed the url in the
address box to the php file.

I'd like to keep the address field to show whatever url the surfer actually
requested.

Someone else suggested adding this to the htaccess.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteRule ^(.*) <a style='text-decoration: underline;' href="http://www.yourdomain.com/pathtofile/page.cgi?$1" target="_blank">http://www.yourdomain.com/pathtofile/page.cgi?$1</a> [R,L]

I did this, but the error that came up was RewriteCond: bad flag delimiters

The administrator for the hosting company said that the mod rewrite doesn't
like "! -f" being used

Any thoughts on how to correct the syntax?



"David Venn-Brown" <davidvb.TakeThisOut@notmydomain.com> wrote in message
news:3fseb.99$MZ5.2761@nnrp1.ozemail.com.au...
 > (a) wrote:
 >
  > > The last thread kind of went off on a tangent, so I'll pose the question
  > > below again. This is not to mess up the search engines because none of
the
  > > 404 pages are linked to one another. Instead, I just want to give the
user
  > > the appearance that the page he requested is still up and running and
not
  > > give him the appearance of a broken link.
  > >
  > > So I kindly ask again, is there a way to have some code that if someone
goes
  > > to a page that is a
  > > 404, it runs an SSI.
  > >
<font color=green>  > > As an example, if someone went to the webpage <a style='text-decoration: underline;' href="http://www.url.com/test1.shtml,</font" target="_blank">www.url.com/test1.shtml,</font</a>>
the
  > > 404 would load the following:
  > >
  > > <!--#include virtual="page.cgi?test1.shtml" -->
  > >
  > > On the other hand, if someone went to the webpage
<a style='text-decoration: underline;' href="http://www.url.com/test2.shtml," target="_blank">www.url.com/test2.shtml,</a>
  > > the 404 would load the following:
  > >
  > > <!--#include virtual="page.cgi?test2.shtml" -->
 > Make this your error document:
 >
 > <?php
 > echo "<!--#include virtual=\"page.cgi?" .
 > substr($_SERVER['REQUEST_URI'], 1) . "\" -->";
 > ?>
 >
 > ... should give you want you need.
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
eric____cartma

External


Since: Sep 25, 2003
Posts: 3



(Msg. 7) Posted: Thu Oct 02, 2003 7:57 am
Post subject: Re: 404 Question Part 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"\(a\)" <nospam.DeleteThis@spam.com> wrote in message news:<Vxoeb.40954$O85.34210@pd7tw1no>...
 > The last thread kind of went off on a tangent, so I'll pose the question
 > below again. This is not to mess up the search engines because none of the
 > 404 pages are linked to one another. Instead, I just want to give the user
 > the appearance that the page he requested is still up and running and not
 > give him the appearance of a broken link.

All you need to do is drop a .htaccess file into the root of your
directory structure with this line:

ErrorDocument 404 <a style='text-decoration: underline;' href="http://myserver/mypage.html" target="_blank">http://myserver/mypage.html</a>


You can add all the other error codes and can also display other
options rather than redirecting. Just check the .htaccess apache docs

EC
..<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 Question Part 2 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PHP: Variable as part of a variable - Here's a confusing one. I want to feed a PHP script a variable value that will be used as part of a variable name when the script runs. $1a = "Something"; $1b = "Something else"; $1c = "Something else entirely"; // Run /...

CSS wizardry needed - part 2 - I'd been redesigning one of my web sites when I read on this group about the advantages of using CSS to do the job of tables for layout. Although I already had a working tables version of my site layout, I thought I'd give it a go, so would like your..

How to get banner advertisers.. part 2 - Sorry about the mispost.... I have a website that is very niche market. I have never had advertisers before but would like to generate a few bucks to help pay for the site. My site drawings in a very specific user. I get 5000+ unique vistors per month...

404 Question - Is there a way to have some code that if someone goes to a page that is a 404, it runs an SSI. As an example, if someone went to the webpage www.url.com/test1.shtml, the 404 would load the following: <!--#include virtual="page.cgi?test1.shtml&q...

PDF Question - Does anyone know of a way of converting a PDF file into Word or frontpage without losing any of the formatting? I have a flyer to turn into a webpage with numerous images and formatted text blocks which if i save as an image takes about 90 secs to..
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]