Hi,
I'm trying to write a rule that finds albums in the root directory but uses an album path. So, lets say I have an album called 'test-album' which is blank, and another album called 'image-album-1' with images in it. I want to be able to type zenphoto/test-album/image-album-1/ and go to zenphoto/image-album-1
shouldn't the re-write look like this:
RewriteRule ^(test-album)/?(.*?)/?$ index.php?album=$2 [QSA]
Thanks!
Comments
You will have to study how to make rewrite rules and make your own. This is not a forum on mod_rewrite rules. I did give you a link to one, there are others.
REDIRECT_URL /zenphoto/index.php
REDIRECT_QUERY_STRING album=sub-album-2
Which is exactly what I want. Why then is it not going to the album? The only thing I can think of is that it's not really looking at the album param, and instead looking at the url.
Can anyone confirm this?
I have gotten it to work now by adding another param into my mod_rewrite and ignoring the function that checks the url in rewrite_get_album_image().
As far as why I'm doing this, it's because the site I'm working on needs duplicate projects in multiple categories (which I'm doing with tags) but also has a highlighted navigation which needs to reflect where the user is. So if a project exists in the root and that's where it's getting re-directed then that doesn't work since it'll lose its context. So now, the mod_rewrite works like this:
RewriteRule ^(cat1|cat2|etc.)/+?([A-Za-z0-9_\-]+){1,}/?$ index.php?album=projects/$2&category=$1&project=1 [L,QSA]
RewriteRule ^(cat1|cat2|etc.)/?$ index.php?album=categories/$1&category=$1 [L,QSA]
RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]
So I can just put all my categories into an album called categories, and all the projects into a projects album, and do the rest with tags.