Ir para conteúdo
View in the app

A better way to browse. Learn more.

Portal do Host

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Config Apache "forbideen"

Featured Replies

Postado

Caros amigos,

 

Estou configurando um servidor com a opção indexes default desabilitada, ou seja, quando um domínio/diretório que não tem um index.php ele mostra a menagem abaixo:

 
Forbidden

You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

 

Dúvida tem como mudar esta mensagem ? Talvez alterando algo na compilação ?


Postado

Claro,

 

Adicione isso no seu .htaccess:

ErrorDocument 404 minhapasta/minha_pagina_de_erro_personalizada_404.html

Isso acima serve pros erros 500,503,403,400, etc... basta trocar o número do erro 

 

:)


Postado
  • Autor

Claro,

 

Adicione isso no seu .htaccess:

ErrorDocument 404 minhapasta/minha_pagina_de_erro_personalizada_404.html

Isso acima serve pros erros 500,503,403,400, etc... basta trocar o número do erro 

 

:)

 

Eis o problema João, eu preciso customizar esta página para todo o servidor como default/padrão.


Postado

Duran, procure este arquivo na pasta do Apache:
 
localized-error-pages
 
No Ubuntu Server fica em /etc/apache2/conf.d/localized-error-pages
 
No  cPanel/Centos6 está em /usr/local/apache/conf/includes/errordocument.conf
 
Bom, em ambos casos é só por a localização da dita cuja página, ficando algo assim:

# Crie um diretorio para as páginas.
# Criei um chamado /var/www/erros

# 2
# Abra o arquivo dos erros do Apache e adicione isso:

Alias /erros /var/www/erros

# 400 - Bad Request
ErrorDocument 400 /erros/400.shtml
 
# 401 - Unauthorized
ErrorDocument 401 /erros/401.shtml
 
# 402 - Payment Required
ErrorDocument 402 /erros/402.shtml
 
# 403 - Forbidden
ErrorDocument 403 /erros/403.shtml
 
# 404 - Not Found
ErrorDocument 404 /erros/404.shtml
 
# 405 - Method Not Allowed
ErrorDocument 405 /erros/405.shtml
 
# 406 - Not Acceptable
ErrorDocument 406 /erros/406.shtml
 
# 407 - Proxy Authentication Required
ErrorDocument 407 /erros/407.shtml
 
# 408 - Request Timeout
ErrorDocument 408 /erros/408.shtml
 
# 409 - Conflict
ErrorDocument 409 /erros/409.shtml
 
# 410 - Gone
ErrorDocument 410 /erros/410.shtml
 
# 411 - Length Required
ErrorDocument 411 /erros/411.shtml
 
# 412 - Precondition Failed
ErrorDocument 412 /erros/412.shtml
 
# 413 - Request Entity Too Large
ErrorDocument 413 /erros/413.shtml
 
# 414 - Request-URI Too Large
ErrorDocument 414 /erros/414.shtml
 
# 415 - Unsupported Media Type
ErrorDocument 415 /erros/415.shtml
 
# 416 - Request Range Not Satisfiable
ErrorDocument 416 /erros/416.shtml
 
# 417 - Expectation Failed
ErrorDocument 417 /erros/417.shtml
 
# 422 - Unprocessable Entity
ErrorDocument 422 /erros/422.shtml
 
# 423 - Locked
ErrorDocument 423 /erros/423.shtml
 
# 424 - Failed Dependency
ErrorDocument 424 /erros/424.shtml
 
# 500 - Internal Server Error
ErrorDocument 500 /erros/500.shtml
 
# 501 - Not Implemented
ErrorDocument 501 /erros/501.shtml
 
# 502 - Bad Gateway
ErrorDocument 502 /erros/502.shtml
 
# 503 - Service Unavailable
ErrorDocument 503 /erros/503.shtml
 
# 504 - Gateway Timeout
ErrorDocument 504 /erros/504.shtml
 
# 505 - HTTP Version Not Supported
ErrorDocument 505 /erros/505.shtml
 
# 506 - Variant Also Negotiates
ErrorDocument 506 /erros/506.shtml
 
# 507 - Insufficient Storage
ErrorDocument 507 /erros/507.shtml
 
# 510 - Not Extended
ErrorDocument 510 /erros/510.shtml
 

 
Ou ainda no cPanel tem outra opção, vá em  "WHM Main >> Service Configuration >> Apache Configuration >> Include Editor". Em "Pre Virtualhost include --> All Version", adicione o conteúdo acima, salve e reinicie o apache.
 
Espero ter ajudado.


Visitante
Este tópico está impedido de receber novos posts.

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Informação Importante

Concorda com os nossos termos?

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.