Jump to content

Archived

This topic is now archived and is closed to further replies.

drcdeath

How would I...

Recommended Posts

How would I get the information from the address bar after the slash using php?

To be more specific I mean this:

www.example.com/mypage.html

Is there a way I can get the "mypage.html" using PHP. I want to create a page with a sentence like this:

"The requested URL "mypage.html" could not be found" If you catch my drift.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Wasn't quite solved :(.

It keeps redirecting to 404.php if I have an error so if I type in www.example.com/asdmkoasndaojsdnasd.php the address bar will change to www.example.com/404.php and not stay as "asdmkoasndaojsdnasd.php" so it says:

"The requested "404.php" was not found"

Any clues? :(

Share this post


Link to post
Share on other sites
If it's custom 404 pages your wanting, you'll have to edit the 404.shtml file to forward those variables to 404.php.

I can't remember the exact instructions but I can find out for you in a second


UPDATE:
take a look at this tutorial
http://www.onlamp.com/pub/a/onlamp/2003/02/13/davidsklar.html

EDIT:
Nevermind, if you have it redirecting to 404.php already on an error then you must already have that setup
you need to tell 404.php to use the $_SERVER['REDIRECT_URL'] variable

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.