[.htaccess]-URL Rewriting makes my stylesheet go 404... :O

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
nickdebink
Forum Newbie
Posts: 1
Joined: Sun Apr 18, 2010 5:17 am

[.htaccess]-URL Rewriting makes my stylesheet go 404... :O

Post by nickdebink »

Hey Guys!,

I just started with .htaccess, and I am currently working on a website that allows you to post and search for recipes...
I already made the index.php rewritable so I don't get this ugly $_GET url, but here is my problem...

I want my url to look like this:

recipes: localhost/recipes/recipe/this_is_a_recipe
search: localhost/recipes/search

Is this possible? Now that I think about it, this wouldn't make sense on an actual domain because it would look like: www.mydomain.com/recipes/recipe/this_is_a_recipe
But anyway, there is one more problem, I would like a slash at the end of my URL, but when I make it work in my .htaccess, my stylesheet cannot be found!

I have really searched all over the internet, and I can't get any good resources on .htaccess, this is the code I'm currently using:

[text]RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?id=$1[/text]

I really hope someone can post a littlebit of code to make this work! :D
Cya guys!
Post Reply