I guess I really just don’t understand how the htaccess works. I want clean URLs for better SEO and just so it looks nicer, but every tutorial I read, they just never go into detail of much.They usually just copy/paste some code and tell you that’s how it’s done, but obviously it’s different for everybody.
My site is split up into multiple directories, one of them is herbs, and the url is “mysite.com/herbs”. All of the data is on a database and automatically creates a page when called from the database. So the URLs come out to “/herbs/index.php?herb=lemonbalm” or whatever herb it is. I’d like to turn that into “/herbs/herb/lemonbalm” or even without the second “herb” in that line.
Right now, I have
RewriteEngine On RewriteRule ^(index)$ $1.php [NC,L] RewriteRule ^([-\w]+)$ index.php?herb=$1 [NC,L] RewriteRule ^herbs/([-\w]+)/$ index.php?herb=$1 [NC,L]
All this is doing is turning my url into “/herbs/?herb=herbs”. Please help me on this. It’s driving me crazy!