Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
htaccess RewriteRule force to put s in the url

htaccess file

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

RewriteRule ^member  member.html [NC,L]
RewriteRule member/(.*)/(.*)$ member.html?a=$1&b=$2

so the should be like https://example.com/member/query_1/query_2

the problem is this link wont work unless I add (s) character to the end of member word in the url

so the working link is https://example.com/members/query_1/query_2

unless it return me 404 error its work fine in the xamp localhost but when I upload to server I have this issue.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You may use this code in site root .htaccess:

Options -MultiViews
RewriteEngine On

RewriteRule ^member/?$ member.html [NC,L]

RewriteRule member/([^/]+)/([^/]+)/?$ member.html?a=$1&b=$2 [L,QSA,NC]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]

Options -MultiViews will turn content negotiation service off. Option MultiViews (see http://httpd.apache.org/docs/2.4/content-negotiation.html) is used by Apache's content negotiation module that runs before mod_rewrite and makes Apache server match extensions of files. So if /file is the URL then Apache will serve /file.html.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda