Hey, I've got a seemingly simple problem, but it's not working for a reason I can't fathom. I'd basically like to turn /fable-2-gallery/categoryname/imagename into /?page_id=14&imgcat=categoryname&imgname=imagename but I'm struggling with making that work. I'm also running wordpress, which may complicate things. This is what's in my .htaccess file: RewriteEngine On RewriteBase / RewriteRule ^fable\-2\-gallery/([a-z]+)$ fable\-2\-gallery/$1/ [R] RewriteRule ^fable\-2\-gallery/([a-z]+)/$ \?page_id=14\&imgcat=$1 [L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Options All -Indexes Code (markup): My intention with the first rewrite rule is to simply add a trailing slash to the image category and force a redirect, but unfortunately that's not working. The second line should make it dynamic for the PHP to kick in, but again, no luck. Can you help me with this, please?
I can't help you with it, but I found a great article a couple days ago that you might find some help in. I hope it helps.... http://www.askapache.com/2006/htaccess/htaccesselite-ultimate-htaccess-article.html
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^fable-2-gallery/([^.]+)/([^.]+)/([^.]+)\.html$ index.php?page_id=$1&imgcat=$2&imgname=$3 [L] /index.php?page_id=WWWWW&imgcat=XXXXXXX&imgname=YYYYYY to /fable-2-gallery/WWWWW/XXXXXX/YYYYYY
Thanks, but it doesn't work unfortunately. All I get is a 404 whenever anything other than a number is entered after /fable-2-gallery/. (Number after page name is how Wordpress directs to different pages in an article.) By the way, page_id is unchaging as it represents fable-2-gallery to Wordpress, so I've only got two parameters.
Run over to the WordPress message boards on their site. They are crummy when it comes to being friendly with mod_rewrite.