PDA

View Full Version : A little rewrite help



mobilebadboy
03-03-2007, 07:46 PM
I had this fixed when my blog was on another domain, but since I've moved it, and it's been so long since I fixed the other one, I don't remember how I did it.

With a trailing slash on the end everything looks/works fine, without it it still pulls the post but my stylesheet won't load). I've got a relative path set for it since I rebuilt the blog and it needs it like that (theme handling).

What I have:


RewriteRule id-([^./]+)/?$ filename.php?id=$1

I'd actually prefer it to always end up with the slash, but I'd be happy just to fix it like it is.

rpanella
03-03-2007, 09:30 PM
Try this:


RewriteRule ^(.*id-[^/]+)$ /$1/ [R=301,L]
RewriteRule id-([^./]+)/?$ filename.php?id=$1

That should redirect and request without a slash to one with the slash.
________
NEVADA DISPENSARY (http://nevada.dispensaries.org/)

mobilebadboy
03-03-2007, 10:08 PM
Thanks, Russell. That seems to have done the trick.