Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-27-2004, 10:09 PM   #1
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
apache technical question anyone!?

Sorry a bit off topic but im in a pinch to find this.

How do you pass the broken link in a 404 to a script? Here is an example:

ErrorDocument 404 404/404.pl?brokenlink=$LinkITried
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:18 PM   #2
masterE
Confirmed User
 
Join Date: Aug 2004
Location: at home! ICQ 199579013
Posts: 366
Use REQUEST_URI

PHP Code:
brokenLink=<!--#echo var="REQUEST_URI" --> 
__________________

Promote Lady Sonia
and earn 60% on sign-up and 60% on rebills!
^^ Weekly CCBill Payouts - Hosted Galleries - Promo Content - Free Hosting ^^
^^ No Cross Sells - No Traffic Leaks - 100% Exclusive Content! ^^
masterE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:20 PM   #3
EscortDate_Enoj
Registered User
 
Join Date: Mar 2002
Location: Norway
Posts: 87
Quote:
Originally posted by MrJackMeHoff
Sorry a bit off topic but im in a pinch to find this.

How do you pass the broken link in a 404 to a script? Here is an example:

ErrorDocument 404 404/404.pl?brokenlink=$LinkITried
I use
Code:
ErrorDocument 404 /index.php?module=error&code=404
and then when index.php is requested by Apache the environment will be as if the file which was not found existed. Take a look at for example the $_SERVER (PHP example) array when you request a 404 file.

I've seen it behave otherwise on other servers though, where the user plainly gets redirected to the 404 page instead. I assume it's some Apache directive for how to show error documents.
EscortDate_Enoj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:22 PM   #4
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by masterE
Use REQUEST_URI

PHP Code:
brokenLink=<!--#echo var="REQUEST_URI" --> 
This doesnt do anything 'cept pass the acho command.. Im needing this for .htaccess.. I tried using php as the 404 and invoking request_uri but all i get is the current script name or the html it came from. Not the link that was 404 to begin with.
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:24 PM   #5
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by EscortDate_Enoj
I use
Code:
ErrorDocument 404 /index.php?module=error&code=404
and then when index.php is requested by Apache the environment will be as if the file which was not found existed. Take a look at for example the $_SERVER (PHP example) array when you request a 404 file.

I've seen it behave otherwise on other servers though, where the user plainly gets redirected to the 404 page instead. I assume it's some Apache directive for how to show error documents.
php is only showing the php as the link I requested on my server. Not the link I really wanted.
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:32 PM   #6
masterE
Confirmed User
 
Join Date: Aug 2004
Location: at home! ICQ 199579013
Posts: 366
Setup a normal 404 page, then request the script in your 404 page with an image tag using the REQUEST_URI
__________________

Promote Lady Sonia
and earn 60% on sign-up and 60% on rebills!
^^ Weekly CCBill Payouts - Hosted Galleries - Promo Content - Free Hosting ^^
^^ No Cross Sells - No Traffic Leaks - 100% Exclusive Content! ^^
masterE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:35 PM   #7
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by masterE
Setup a normal 404 page, then request the script in your 404 page with an image tag using the REQUEST_URI
Say what? Oh I just found out I cant use php anyway it has to be perl.


there isnt just a fucking variable in apache to pass this? Geez why does this have to be so difficult? ;)
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:40 PM   #8
andi_germany
Confirmed User
 
Join Date: Oct 2002
Location: Germany
Posts: 768
You have to edit your httpd.conf and and uncomment or add the ErrorDocument 404 directive. This can be set global or in your virtual section.

ErrorDocument 404 /404.html works as well as a external redirect with a complete URL. (note that in this example 404.html would have to be present in your document root dir.)

There should be some example lines in your httpd.conf

If you don't have access to your conf files you can also use .htaccess to forward the404 errors
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

Last edited by andi_germany; 09-27-2004 at 10:42 PM..
andi_germany is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:41 PM   #9
lb_vee
Confirmed User
 
Join Date: May 2004
Posts: 886
Quote:
Originally posted by MrJackMeHoff
Sorry a bit off topic but im in a pinch to find this.

How do you pass the broken link in a 404 to a script? Here is an example:

ErrorDocument 404 404/404.pl?brokenlink=$LinkITried
try adding a slash in front of the first directory.
lb_vee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:46 PM   #10
lb_vee
Confirmed User
 
Join Date: May 2004
Posts: 886
I just realized you're trying to pass a variable to it.

The referer will be picked up by the script automatically. If you're using perl as cgi, look into the CGI.pm docs to see how its passed.

If its mod-perl, checkout the Apache::Registry docs

I think the refering url is also an @ENV variable.

$ENV{'HTTP_REFERER'};

Replace the haha shit up top with a shift+[

Last edited by lb_vee; 09-27-2004 at 10:47 PM..
lb_vee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:48 PM   #11
Theodor S. Geisel
Confirmed User
 
Join Date: Jul 2003
Location: United States
Posts: 349
Quote:
Originally posted by MrJackMeHoff
Sorry a bit off topic but im in a pinch to find this.

How do you pass the broken link in a 404 to a script? Here is an example:

ErrorDocument 404 404/404.pl?brokenlink=$LinkITried
2 things you have to keep in mind.

1. Make sure everything is relative. /404/404.pl is a good start.
2. IE will *NOT* show your custom 404 page if your 404 page is less than 10k. You can just fill the damn page with dots. That'll work.
__________________
Theodor S. Geisel
[ ICQ: 2 0 6 6 1 0 7 ]
[ theodor.geisel -at- gmail -d0t- com ]
[ PROGRAMMER :: PHP :: MYSQL :: HTML/CSS ]
Theodor S. Geisel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 10:59 PM   #12
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by a1escorts
I just realized you're trying to pass a variable to it.

The referer will be picked up by the script automatically. If you're using perl as cgi, look into the CGI.pm docs to see how its passed.

If its mod-perl, checkout the Apache::Registry docs

I think the refering url is also an @ENV variable.

$ENV{'HTTP_REFERER'};

Replace the haha shit up top with a shift+[
I dont want the referer I want the link you click on that is dead so i can work with it in perl. I have the referer already. ;)
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 11:00 PM   #13
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by Theodor S. Geisel
2 things you have to keep in mind.

1. Make sure everything is relative. /404/404.pl is a good start.
2. IE will *NOT* show your custom 404 page if your 404 page is less than 10k. You can just fill the damn page with dots. That'll work.
The script runs fine just no way to display the link that was dead in the first place.
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-27-2004, 11:12 PM   #14
lb_vee
Confirmed User
 
Join Date: May 2004
Posts: 886
Quote:
Originally posted by MrJackMeHoff
The script runs fine just no way to display the link that was dead in the first place.
in the environment variables, look at REDIRECT_ERROR_NOTES or REQUEST_URI, thats the page that called the 404 (the page that doesnt exist)
lb_vee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-28-2004, 12:13 AM   #15
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
Quote:
Originally posted by a1escorts
in the environment variables, look at REDIRECT_ERROR_NOTES or REQUEST_URI, thats the page that called the 404 (the page that doesnt exist)
No matter what I do I just get the page the person was last on or the page they are currently on I cant seem to get the page they wanted to be on that was 404.
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-28-2004, 12:28 PM   #16
lb_vee
Confirmed User
 
Join Date: May 2004
Posts: 886
Quote:
Originally posted by MrJackMeHoff
No matter what I do I just get the page the person was last on or the page they are currently on I cant seem to get the page they wanted to be on that was 404.
does the 404 redirection work??

I tested this on one of my servers and it works fine. Double check your perl / apache settings.
lb_vee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.