My end goal is to make
http://www.domainname.de/anyname
(actual page will not exist as such)
redirect to a page that will take the URL, and split out the "anyname"
into a variable.
My idea was to create a custom error page using .htaccess.
It works fine when accessed from a link but of course if the URL has been
typed in there is no "referer"
Be grateful for any ideas or even a better way to do the whole thing!!!
Chris
capture the typed URL on custom error
Moderators: egami, macek, gesf
-
- New php-forum User
- Posts: 19
- Joined: Sun Aug 18, 2002 4:02 am
- Location: Germany
There's no such thing as a stupid question - but I try!!
Off the top of my head it's $_SERVER['REQUEST_URI']! You could always try the print_r($_SERVER) command to print out all the variables, and pick it out, but I'm pretty sure it's the $_SERVER['REQUEST_URI'] one!
-
- New php-forum User
- Posts: 19
- Joined: Sun Aug 18, 2002 4:02 am
- Location: Germany
Hi,
Many thanks again for the promt answer. Your print_r($_SERVER) worked beautifully unfortunately though it told me I was barking up the wrong tree.
$_SERVER['REQUEST_URI']! didn't give the URL that was typed. Although I think that one does give the refering URL if it's from a link.
From what I've read the only route is to use a CGI program - another skill to master!!!
If you don't mind I'm sure I'll be back!!!
Chris
Many thanks again for the promt answer. Your print_r($_SERVER) worked beautifully unfortunately though it told me I was barking up the wrong tree.
$_SERVER['REQUEST_URI']! didn't give the URL that was typed. Although I think that one does give the refering URL if it's from a link.
From what I've read the only route is to use a CGI program - another skill to master!!!
If you don't mind I'm sure I'll be back!!!
Chris
There's no such thing as a stupid question - but I try!!
There is one option, I know because I use it - I'm just too lazy to go out and find out which one it is though!
-
- New php-forum User
- Posts: 19
- Joined: Sun Aug 18, 2002 4:02 am
- Location: Germany
Thought I'd let you know I eventally worked out the problem why I could get $_SERVER['REQUEST_URI'] to work.
I'm running IIS. When I upload to my apache server it worked!!!
Many thanks -(and sorry for doubting!!)
I'm running IIS. When I upload to my apache server it worked!!!
Many thanks -(and sorry for doubting!!)
There's no such thing as a stupid question - but I try!!
-
- New php-forum User
- Posts: 19
- Joined: Sun Aug 18, 2002 4:02 am
- Location: Germany
I had been doing other things in the mean time - you know changing nappies and things!!!
There's no such thing as a stupid question - but I try!!