I have a simple HTML project sat on a hosting account in a folder called 'buddies', its full url looks something like this http://www.example.com/buddies/
I'm trying to re-write URL's to point to PHP files like this;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ((?:css|images|js)/.*)$ /$1 [L]
# About Us
RewriteRule ^about_us/what_we_do/?$ about-what-we-do.php [NC,L]
RewriteRule ^about_us/mission/?$ about-our-mission.php [NC,L]
RewriteRule ^about_us/team/?$ about-team.php [NC,L]
RewriteRule ^about_us/what_next/?$ about-what-next.php [NC,L]
# Classes
RewriteRule ^classes/learn/?$ classes-learn.php [NC,L]
RewriteRule ^classes/1to1/?$ classes-one-to-one.php [NC,L]
RewriteRule ^classes/swim_fit/?$ class-swim-fit.php [NC,L]
# Information
RewriteRule ^information/timetable/?$ info-timetable.php [NC,L]
RewriteRule ^information/contact/?$ info-contact.php [NC,L]
RewriteRule ^information/location/?$ info-locations.php [NC,L]
This works great at redirecting to the URL to the correct PHP file, however in doing this it's broke the links to all images and css files. I understand why it's doing it, the css and images folders don't exist in the path 'about_us/what_we_do/'
If this was running in the root of the domain, I'd simply prepend a '/' to the front of all images/css files i.e. '/css/style.css' rather than how they're currently referenced 'css/style.css'.
Can someone suggest a way in which I can still server css, images and javascript from the folders 'css', 'images' and 'js'? Without me having to prepend the 'buddies' folder to each and every css/image reference.
EDIT: I'm referencing the stylesheet like this;
<!-- Stylesheet -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/style-768.css">
<link rel="stylesheet" type="text/css" href="css/style-992.css">