Jump to content
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.

Featured Replies

  • Administration

{Aquele momento em que nem eu sei onde postar um tópico...}

 

Tenho problemas crônicos de redirecionamento com o Nginx às vezes. Estou empacada em uma situação:

 

Preciso redirecionar dominio.com/pasta/pasta/pasta/pasta/arquivo.php e preciso que esta belezura fique amigável assim: dominio.com/arquivo (respeitando o último arquivo)

 

Olha, já usei o try_files, if (mesmo o nginx condenando), o problema é que funciona somente para pastas. Quando eu uso o arquivo.php, ele não funciona.

 

Em .htaccess ficaria assim:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sistema/(.+)$ blog/pasta/subpasta/outrapasta/$1 [L]

*Todos os arquivos precisam do .php no final no meu sistema.

 

Também já tentei vários geradores online.


deixa eu ver se entendi, você quer fazer links amigavel?

Só que fica a extensão .php ainda assim?
Tente assim.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sistema/(.+)$ blog/pasta/subpasta/outrapasta/$1.php [L]
RewriteRule ^sistema/(.+)$ blog/pasta/subpasta/outrapasta/$1 [L]

Chamou? Estamos ai!



server {
    ...
    rewrite ^/pasta/pasta/pasta/arquivo.php arquivo last;
    ...
}

Não tenho certeza do código, mas tenho anotado em algum lugar. Vagamente me lembro do código acima, testa ai :)






Isso. Nossa, foi uma luta até perceber que não era dentro do location.

 

Essas broncas tiram qualquer um do sério! rs


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Do you agree with our terms?

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.