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

130
Visualizações
Prevent RewriteRule to influence loading scripts and stylesheets

.htaccess file :

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]    # <= This is the problem

HTML Head :

<!DOCTYPE html>
<html>
<head>
    <script src="./scripts/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="./styles/styles.css">
</head>
[...]

It seems that the RewriteRule prevents all local scripts and stylesheets from loading...

How can I solve that problem ?

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

0

with your RewriteRule, you rewrite all files, even ./*.js and ./*.css files.

You should add RewriteCond this to try:

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [NC,QSA,L]    # <= This is the problem

Thus apache rewrites nonexistent files such as foo, bar, ... to index.php.

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