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

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

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 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!