![]() |
|
Alternative mod_rewrite for a few albums - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Alternative mod_rewrite for a few albums (/thread-974.html) |
Alternative mod_rewrite for a few albums - snagt - 2006-12-14 First of all - thank you [i]very[/i] much for the script and the wonderful support, trisweb! I'd like to have some albums mod_rewritten like this: And the rest all rewritten like: Question 1. I've tried playing around with it, putting a .htaccess in the root of my website: `RewriteRule ^drawings/$ zenphoto/index.php?album=drawings RewriteRule ^drawings/page/([0-9]+)/?$ zenphoto/index.php?album=drawings&page=$2 RewriteRule ^drawings/image/(thumb|[0-9]{1,4})/([^/]+)$ zenphoto/zen/i.php?a=drawings&i=$3&s=$2 RewriteRule ^drawings/image/([^/]+)$ zenphoto/albums/drawings/$2 RewriteRule ^drawings/([^/]+)$ zenphoto/index.php?album=drawings&image=$2 RewriteRule ^photography/$ zenphoto/index.php?album=photography RewriteRule ^photography/page/([0-9]+)/?$ zenphoto/index.php?album=photography&page=$2 RewriteRule ^photography/image/(thumb|[0-9]{1,4})/([^/]+)$ zenphoto/zen/i.php?a=photography&i=$3&s=$2 RewriteRule ^photography/image/([^/]+)$ zenphoto/albums/photography/$2 RewriteRule ^photography/([^/]+)$ zenphoto/index.php?album=photography&image=$2
Is it because the two .htaccess files conflict with each other? Would it be tidier to do all the mod_rewriting in the zenphoto .htaccess file? Alternative mod_rewrite for a few albums - trisweb - 2006-12-14 Hmm... try... ` RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUEST_FILENAME} -d [NC] RewriteRule ^.*$ - [R,L] RewriteRule drawings/?(.*) zenphoto/drawings/$1 [R,L] RewriteRule photography/?(.*) zenphoto/$1 [R,L]` You've got the right idea I think, it just needs to pass it on to ZP.... that's what [R] is for (Redirect). Hope you don't mind, that actually does redirect the URL in the browser. There may be better ways to do it, I'm not sure... Wooo it's late, gnight. |