htaccess Resource interpreted as Stylesheet but transferred with MIME type text/html

Viewed 1728

Im trying to rewrite my existing url from http://localhost/website/article.php?id=5 to http://localhost/website/article/5 hence my htaccess code

RewriteBase /website/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule article/([a-zA-Z0-9@.-])? article.php?id=$1 [L]

What I get is Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/website/article/css/bootstrap.min.css".

It appears that article is added to the file's url, redirecting even the file directories.

The real url should be "http://localhost/website/css/bootstrap.min.css"

Im quite new to htaccess and trying to create my own by copying from existing ones

REVISION

My actual problem is that my resources url is being renamed as well. I've eliminated lines of codes down to 2 lines

RewriteEngine On
RewriteRule article/([0-9@.-])  article.php?id=$1 

but now the resources is being redirected to non existent http://localhost/website/article/js/main.js instead of http://localhost/website/js/main.js

3 Answers
Related