Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
display failed url on 404 error page
i’d like to display the url that failed on my error page. how can i do this?
my former web host enabled me to simply put #echo var=“REQUEST_URI”
Would something like that work within TxP?
Offline
#2 2006-09-01 05:02:24
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: display failed url on 404 error page
Yes.
Here’s what I use on my blog: <txp:php>echo $_SERVER['REQUEST_URI'];</txp:php>
Offline
#3 2006-09-01 05:18:22
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: display failed url on 404 error page
<txp:page_url />
Alex
Offline
Re: display failed url on 404 error page
Mary wrote:
Here’s what I use on my blog:
<txp:php>echo $_SERVER['REQUEST_URI'];</txp:php>
That would allow Javascript injection, and somebody could steel your cookies (if he could trick you into clicking a link, or redirected you to such a link).
Offline
#5 2006-09-01 07:27:32
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: display failed url on 404 error page
True (forgot to escape). I’ve been doing that since before page_url existed, and then when it did, I forgot about it.
Offline
Re: display failed url on 404 error page
Thanks. I thought something like that must exist. But <txp:page_url /> was not in <b>textbook</b>. I do see it as a function now, but it’s not listed as a tag. I’ve start a new page for the tag. Let me know if I didn’t do this right!
Offline
Pages: 1