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

112
Visualizações
.htaccess change wordpress hompage but keep the link

example.com/wp or example.com/wp/

<- This is what homepage link used to be like and I'm trying to keep it this way. But I want the server to serve some static page from another subfolder as a front page (but to keep all the other wp contents at the same places)

My static page (several of them tbh) are stored in root/subf1/

I was able to redirect to the desired subfolder, but the path also shows up in the URL. Is it possible to change example.com/subf1 to example/wp?

Here's my current htaccess. Maybe I need to create another one in a static page folder?

<IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteCond %{REQUEST_URI} !^/subf1/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /test/page/$1
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteRule ^(/)?$ /subf1/index.html [L] 
 </IfModule>

RedirectMatch "^/wp$" "https://example.com/subf1/"

Thank you a lot for your time

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

0

RedirectMatch does only "external redirections", so you probably want internal redirection with a RewriteRule (without the R flag).

So instead of RedirectMatch try:

RewriteRule ^wp$ https://example.com/subf1/ [L]

PS: Generally it is good to go for redirect/redirectmatch instead of going for mod_rewrite, but if you are already using mod_rewrite directives it will be less confusing to stick to it and not mix direcitves from one or the other.

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