0

I have problem with css when use this htacces code RewriteEngine On RewriteRule ^([^/])/([^/])$ /index.php?id=$1&page=$2 [L]

mode_rewrite work ok but css is not :(
How to fix?

2
Contributors
5
Replies
33
Views
4 Years
Discussion Span
Last Post by cereal
0

Can you explain better? Are you referring to the css directory? You can disable the rewrite for some directories by adding this rule above yours:

RewriteRule ^(css|images|js|fonts) - [L]

If this does not solves then paste the entire rewrite rule and explain the issue, bye.

0

Sorry i have problem that I have not noticed
when put code for mod_rewrite for url then my css not work but when put

 RewriteRule ^(css|images|js|fonts) - [L]

then css work but url not! :(

0

What kind of error do you get? Have you verified the error and access log files of your web server? From these files you can check the generated error codes.

This is working for me:

RewriteEngine On
RewriteRule ^(css|images|js|fonts) - [L]
RewriteRule ^([0-9]+)/([a-zA-Z0-9_-]+)$ index.php?id=$1&page=$2 [L]

If you try to access directly to the CSS file what header responses and contents do you get? If it is not configured properly, the server will try to return the index page contents instead of the CSS file. Usually the browser will return a blank page or will not reload. So you can try to debug by using:

curl http://localhost/css/file.css 

If you don't have access to a cURL client, then you can use POSTMan, an extension for Google Chrome:

Once installed just open the tab and paste the URL of the CSS file, perform a GET request and see what you get.

Another possible solution is to place an .htaccess file inside the CSS directory, in this file you have to disable the rewrite engine:

RewriteEngine Off

Bye.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.