skip to Main Content

Im using an htaccess to load my php files, and the mvc works good but I cannot load files like images, js, css, etc..

My folder structure its the same as Laravel and my .htaccess file is:

RewriteEngine On
RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA]

If i modify the code I can load the images and some differents roots but i cannot load the /

Any help its appreciated

2

Answers


  1. Chosen as BEST ANSWER

    The way that I fixed my problem was replacing the code in the question for this one

    RewriteEngine On
    RewriteRule ^(.*?).(css|js|jpg|jpeg|png|pdf)$ - [L]
    RewriteRule ^(.+)$ index.php?url=$1 [L,QSA]


  2. <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search