Jump to content

Recommended Posts

Posted

Bom dia amigos,

tenho um site em php e utiliza url amigável. Recentemente comprei um certificado SSL e gostaria de redirecionar toda url para o https porém não estou tendo sucesso com os meus testes.

 

Atualmente meu .htaccess funciona somente com URL amigável:

 

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

 

 

Já achei algumas dicas de como fazer simples redirecionamentos do http para https, mas não consigo integrar com o URL amigável acima.

https://wiki.apache.org/httpd/RewriteHTTPToHTTPS

https://www.ndchost.com/wiki/apache/redirect-http-to-https

 

Alguém pode me ajudar?


Posted

Olá @Glariston @Lucas Moraes, muito obrigado pela atenção de vocês.

 

Testei ambas as formas e não funcionou!

 

Quando tento acessar a URL retorna:

 

Not Found
The requested URL /busca/lanches was not found on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

 

Esse tal de .htaccess é difícil e confuso hehehe

Posted

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://TEUDOMINIO/$1[R,L]

 

Exatamente isso que o Glariston falou, hoje pela manhã fiz uma postagem no meu site sobre o assunto :)

No caso a RewriteCond irá restringir sobre quais requisições estão sujeitas a avaliação por uma RewriteRule.

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?

-