skolind
skolind

Reputation: 1754

mod_rewrite .htaccess - Stylesheets mess up

I'm trying to rewrite some URL's on my website, and it works fine, I just have some issues with the stylesheets. All stylesheets works at index.php but not when url's like: localhost:8888/folder/path/(1,2,3,4)

I have my stylesheets in a file where they're listed like this:

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="includes/css/site.css"/>
<link rel="stylesheet" href="includes/css/viewProfile.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="includes/css/viewProvider.css" type="text/css" media="screen"   title="no title" charset="utf-8">

Is there a way to fix this with mod_rewrite or how would I fix this?

Upvotes: 2

Views: 345

Answers (1)

Joey
Joey

Reputation: 354824

This is because you use a relative path to the style sheets. Note that the browser sends requests to

localhost:8888/folder/path/includes/css/...

in that case. If the styles always reside in that configuration at the server root, you could simply make the relative URI an absolute one. Or you remove the path portion for CSS files on the server side.

Upvotes: 1

Related Questions