Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!