Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-08-28 17:39:37
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
How to set an error page for my case (look at the post)
I have a strange question, I hope you can understand. I need to set an error page to prevent it open a strange page with portions of articles, when someone call the directory of a certain file, instead of the same file.
I don’t know what’s the name of this error and how to set it in text-pattern.
For example, what is occurring is that:
/directory1/ opens in a certain page containing portions of the articles who opens from
/directory1/file1.html
all this is indexed by google and generally it appears wherever I don’t like it. :-(
Offline
#2 2010-08-28 18:00:07
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
If I understand you correctly, you can do that by placing an .htaccess file in the directory, with this content:
Options All -Indexes
Offline
#3 2010-08-28 20:02:35
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Ok thank you. But what will be the result? It will appear an error messsage instead of a ‘strange’ page?
Offline
#4 2010-08-28 20:43:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
It will show something like this :)
Offline
#5 2010-08-29 10:18:54
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Thank you, very much, Els.
Offline
Re: How to set an error page for my case (look at the post)
You can add ErrorDocument 403 http://www.neme.org/403.php
at the top of your htaccess and redirect your visitors to a custom page should you wish.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#7 2010-08-31 20:38:23
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Thank you, very much, Els.
Offline
#8 2010-11-21 21:07:00
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
I revised only now this forum page, applying what you answered me on the 31th of August -
(First of all I need to apologize with Colak that previously I didn’t thank, for his answer. I quickly thought the answer was from Els).
Unfortunately all this does not work:
- I already had an external script ‘/error/error.php’ , working in the static site.
In .htacces I also had:
ErrorDocument 400 /errore/errore.php?400
ErrorDocument 401 /errore/errore.php?401
ErrorDocument 403 /errore/errore.php?403
ErrorDocument 404 /errore/errore.php?404
ErrorDocument 500 /errore/errore.php?500
working good in the static site.
When I have inserted : Options All -Indexes below
I get: ‘internal server error’.
Without ‘Options All -Indexes’ I have a default error page, whose graphical output I have also customized and it works well, but only with 404 error.
For 403 occurs again what I asked here on the 31th of August.
Does anyone has a solution for my question?
Last edited by Bongo-man (2010-11-21 21:09:11)
Offline
#9 2010-11-21 21:15:40
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
Bongo-man wrote:
ErrorDocument 400 /errore/errore.php?400
ErrorDocument 401 /errore/errore.php?401
ErrorDocument 403 /errore/errore.php?403
ErrorDocument 404 /errore/errore.php?404
ErrorDocument 500 /errore/errore.php?500
And it doesn’t make a difference if you change it like this?
ErrorDocument 400 http://site.com/errore/errore.php?400
etcetera
Offline
#10 2010-11-22 05:55:21
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
Nothing changes with the ‘internal server error’.
Perhaps could be usefull I express better what’s the problem:
/directory1/ is the section
-> /directory1/file1.html is /directory1/filename1.html
file name 1 page opens also when I type
because error 403 does not work.
Could be a CHMOD problem?
In the static site I think the redirect to the 403 page is automated by the prevention to the access to (es.) /directory1/ but in this case I cannot give a CHMOD 755 to not having physical directory URLs being this, only a section name.
Last edited by Bongo-man (2010-11-22 07:54:24)
Offline
#11 2010-11-22 08:13:17
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to set an error page for my case (look at the post)
How can you have a /directory1/filename1.html if directory1 is only a section?
Offline
#12 2010-11-22 18:46:12
- Bongo-man
- Member
- Registered: 2009-03-18
- Posts: 243
Re: How to set an error page for my case (look at the post)
I can’t understand. What’s strange?
I created a template named (i.e.) ‘subject-articles’ – > I created a section: /car-articles/, whose template is ‘subject articles’.
Then I created ‘filename1.html’ (es. ferrarired1.html) putting it into the section ‘/car articles/’ so that I have now: http://www.mysite.xxx/car-articles/ferrarired1.html , that displays my article.
When I type: http://www.mysite.xxx/car-articles/ferrarir I get ‘error 404’
when I type: http://www.mysite.xxx/car-articles/ I don’t get ‘error 403’, but
it displays the same article of http://www.mysite.xxx/car-articles/ferrarired1.html , without its title.
Consequently Google take up only the description (not the title of the page) and it does not also report my web site name, in some snippets it generates.
Offline