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

306
Visualizações
CSS not loading when using .htaccess

This is my file structure: you can see it here or

-resources/
--css/
---index.css
-src/
--views/
---main.view.php
--main.php
index.php
.htaccess

This is my .htaccess:

RewriteEngine On

RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]

This is how I include the CSS in the view

<link rel="stylesheet" href="resources/css/index.css">

Problem: When I Include main.php (that includes the view) in index.php the CSS does not work no matter where I place the index.css. Any hint?

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

0

You need to add in a rule to exclude rewriting of assets

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
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