ZenphotoCMS Forum
Hard URLs - 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: Hard URLs (/thread-1046.html)



Hard URLs - SubJunk - 2007-01-06

Hi, is there a way to have zenphoto generate URLs that are normal instead of PHP queries? So instead of having, say, "index.php?image=blabla" it would be "/image/blabla"?
I seem to remember some way of doing that, or am I just imagining things?
The problem is of course that search engines only see my site as consisting of one page, which isn't too good.
Cheers




Hard URLs - pearofducks - 2007-01-06

try this:

global $_zp_current_image;
$crntimg = $_zp_current_image->getFullImage();
$HTTP_HOST = getenv('HTTP_HOST');
$current_image = "http://$HTTP_HOST$crntimg";




Hard URLs - Chilifrei64 - 2007-01-06

or you could enable mod-rewrite in the zp-config.php then edit your .htaccess file accordingly. This is obviously apache only..




Hard URLs - trisweb - 2007-01-06

Correct, that's what mod_rewrite does. You need to have apache, the mod_rewrite module, and a correctly configured .htaccess for it to work. There are a lot of posts on the forums if you need help.




Hard URLs - SubJunk - 2007-01-07

Ah okay, I wondered what all this mod rewrite business was about. I'll look it up, thanks guys




Hard URLs - SubJunk - 2007-01-07

Okay I've never used this before... I have the link URLs working, but having a little trouble with the image ones.
I'm using, for example:
RewriteRule ^(.*)/image/thumb/(.*) /zen/i.php?a=$1&i=$2&s=thumb
Sorry if that looks silly, haha What's wrong with it?




Hard URLs - SubJunk - 2007-01-07

My URL ones that are working are:
`RewriteRule ^(.)/(.).php /index.php?album=$1&image=$2

RewriteRule ^(.*)/ /index.php?album=$1`
Is that how they are supposed to be?




Hard URLs - SubJunk - 2007-01-07

Ohh I see it's already in the htaccess file. I wasn't using the htaccess that came with zenphoto. Sorry for the silly questions haha