Forum Moderators: coopster

Message Too Old, No Replies

how to get incorrect url link

         

haian82

2:31 am on Jun 28, 2007 (gmt 0)

10+ Year Member



Hi

I'm using PHP with apache,
I want get the incorrect link that people go to my site, but I don't know how to do
example: my correct link is http://example.com/help/php/

but one person type http://example.com/help/php4/ and that link does not exist on my site. But I still want to get that incorrect link for my purpose.

Anyone can help me?
thanks you!

[edited by: jatar_k at 3:19 am (utc) on June 28, 2007]
[edit reason] please use example.com [/edit]

Gian04

3:00 am on Jun 28, 2007 (gmt 0)

10+ Year Member



Then create a custom 404 page. Check your cPanel, there is an option to customize your 404 page there.

Habtom

7:45 am on Jun 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



but one person type http://example.com/help/php4/ and that link does not exist on my site. But I still want to get that incorrect link for my purpose.

Then create a custom 404 page.

I think Haian is trying to save the last invalid URL while it is handled by 404 page. If that is what you are looking for, this can get you the last URL :

$last_invalid_url = getenv('HTTP_REFERER');

You can email it from here, or save into a database, but $last_invalid_url will contain the last accessed invalid page.

Habtom

[edited by: Habtom at 7:52 am (utc) on June 28, 2007]

haian82

9:22 am on Jul 2, 2007 (gmt 0)

10+ Year Member



thanks all

i did it .
in file HTTP_NOT_FOUND.html.var, I insert this code

<script>
location.href="http://example.com/load/index.php?url=http://example.com<!--#echo var="REQUEST_URI" -->";
</script>

Then it will return that url to the page I want get url

[edited by: dreamcatcher at 8:36 am (utc) on July 4, 2007]
[edit reason] Please use example.com [/edit]

Habtom

6:54 am on Jul 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does that mean your register_globals are on?