G
G
Gene Hagmt2019-06-22 18:51:12
htaccess
Gene Hagmt, 2019-06-22 18:51:12

Due to a setting in .htaccess, loading styles doesn't work. How to fix?

In .htaccess I wrote:

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php [QSA,L]

to process requests in index.php and include the necessary files there depending on the entered url. But because of this, the following problem appears:
For example, the user enters "site.com/home", the home.php file is included in index.php, it contains html markup. But styles are not connected in this way:
<link rel="stylesheet" type="text/css" href="css/style.css">

If rewritten like this:
<style type="text/css"><?php include("css/style.css"); ?></style>

then it works. But it's like a crutch. How to do it normally? Can htaccess be rewritten?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
im_dimas, 2019-06-22
@g_hagmt

RewriteRule ^css\/.* - [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question