mod_rewrite and pretty urls
Posted: Thu Sep 28, 2006 2:07 pm
I am trying to build an application with prettier urls (no query strings). So far I've had no problems because I've always just used a full url to my stylesheets. Well... I would like to be able to use a relative path and not have to define a wwwroot variable in my config.
So my html would look like this:
My directory structure is like this...
and my .htaccess file looks like this:
but the link tag to my stylesheet just isn't working. It doesn't load my stylesheet. Anybody know what I'm doing wrong?
So my html would look like this:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel='stylesheet' href='styles/style.css' type='text/css'> </head>
<body>
<!-- Body //-->
</body>
</html>
Code: Select all
-root
-application
+controller
+model
+view
+library
-public
+images
+scripts
-styles
style.css
.htaccess
index.phpCode: Select all
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
</IfModule>