Member
Member
lauravink   2009-01-25, 08:39
#1

The problem is as following:

I have the domain http://www.lauravink.in.
Laura Vink is me, and I want to use this website to show of pictures from my travels. I choose the .in domain so I could use folders of where I've been; for example: http://www.lauravink.in/poland

For my photos to show I want to use (ofcourse) Zenphoto. I don't want to upload a new ZenPhoto CMS to every folder, but just ones, in the folder /gallery, so I could manage my pictures (and layout) from one place (and also saves webspace).

But if I use ZenPhoto in the galleryfolder (or root), than the URL of a album would be something like: http://www.lauravink.in/gallery/index.php?album=poland, instead of the http://www.lauravink.in/poland/ as I would like it to be.

I know it is possible to rewrite the URL with the .htaccess, but I think it's so difficult! Could someone please help me?

I thought of something like:

RewriteRule ^index.php?album\=(.*)$ /$1/ [R]

in the .htaccess folder, but this doesn't work..

Thank you very much.

Laura Vink
http://www.lauravink.nl

Administrator
Administrator
acrylian   2009-01-25, 10:57
#2

htaccess is a tricky thing.. I fear I can't help with that currently. The easiest would be to install Zenphoto in the root. I see you use also Pixelpost, since that is in a subfolder it might be possible to do that depending on how the index page is named and created.

Member
Member
lauravink   2009-01-25, 18:04
#3

Installing Zenphoto in the root is ofcourse also an option if it makes it easier.
Then the only thing that needs be replace is

lauravink.in / index.php?album=paris to lauravink.in / paris.

But still.. how?

I won't be using Pixelpost, I do use this in my .nl domain, but I won't in my .in domain (where this topic is about).

I hope some else can help me with it!

Administrator
Administrator
acrylian   2009-01-25, 19:17
#4

Ok, I of coures don't know how your site is setup in detail but for the blog you use Pixelpost. Anyway, I would say just install Zenphoto in the root, that is the easiest solution. The you will get exactly what you need. Zenphoto runs absolutly fine in the root.

Member
Member
lauravink   2009-01-25, 20:56
#5

I've installed Zenphoto in the root and have made an new .htaccess.
It still doesn't work though. I have no idea what I'm doing wrong.

My .htaccess looks like this

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.lauravink.in$ [NC]
RewriteRule ^(.*)$ http://lauravink.in/$1 [R=301,L]

RewriteRule ^index.php?album\=(.*)$ $1 [R]

Any ideas anyone?

Member
Member
lauravink   2009-01-25, 22:19
#6

I just found out that I do need to edit the .htacces that comes with the setup. Now my .htaccess looks like this:

htaccess file version 1.2.2.0;


Update the above and the define in setup.php when you make changes to the rewrite rules!


NOTE: Change the RewriteBase below to the absolute path to your zenphoto directory. (Or let setup.php do it for you!)


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.lauravink.in$ [NC]
RewriteRule ^(.*)$ http://lauravink.in/$1 [R=301,L]

!!! Change this to the web path (eg: http://www.yourwebsite.com/photos --> /photos) !!!


RewriteBase /


RewriteRule ^admin/?$ zp-core/admin.php [R,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]

RewriteRule index.php$ index.php [L,QSA]
RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9-]+)/?$ index.php?p=$1 [L,QSA]
RewriteRule ^page/([A-Za-z0-9-
]+)/([0-9]+)/?$ index.php?p=$1&page=$2 [L,QSA]
RewriteRule ^(.)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
RewriteRule ^(.
)/page/([A-Za-z0-9-_]+)/?$ index.php?album=$1&p=$2 [L,QSA]

Rewrite rule addition for search


RewriteRule ^page/search/fields([0-9]+)/(.)/([0-9]+)/?$ index.php?p=search&searchfields=$1&words=$2&page=$3 [L,QSA]
RewriteRule ^page/search/fields([0-9]+)/(.
)/?$ index.php?p=search&searchfields=$1&words=$2 [L,QSA]
RewriteRule ^page/search/archive/(.)/([0-9]+)/?$ index.php?p=search&date=$1&page=$2 [L,QSA]
RewriteRule ^page/search/archive/(.
)/?$ index.php?p=search&date=$1 [L,QSA]
RewriteRule ^page/search/tags/(.)/([0-9]+)/?$ index.php?p=search&searchfields=4&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/tags/(.
)/?$ index.php?p=search&searchfields=4&words=$1 [L,QSA]
RewriteRule ^page/search/(.)/([0-9]+)/?$ index.php?p=search&words=$1&page=$2 [L,QSA]
RewriteRule ^page/search/(.
)/?$ index.php?p=search&words=$1 [L,QSA]

Rewrite additions for zenpage


RewriteRule ^pages/?$      index.php?p=pages [L,QSA]

RewriteRule ^pages/(.)/?$ index.php?p=pages&title=$1 [L,QSA]
RewriteRule ^news/?$ index.php?p=news [L,QSA]
RewriteRule ^news/([0-9]+)/?$ index.php?p=news&page=$1 [L,QSA]
RewriteRule ^news/category/(.
)/([0-9]+)/?$ index.php?p=news&category=$1&page=$2 [L,QSA]
RewriteRule ^news/category/(.)/?$ index.php?p=news&category=$1 [L,QSA]
RewriteRule ^news/archive/(.
)/([0-9]+)/?$ index.php?p=news&date=$1&page=$2 [L,QSA]
RewriteRule ^news/archive/(.)/?$ index.php?p=news&date=$1 [L,QSA]
RewriteRule ^news/(.
)/?$ index.php?p=news&title=$1 [L,QSA]

RewriteRule ^(.)/image/(thumb|[0-9]{1,4})/([^/\]+)$ zp-core/i.php?a=$1&i=$3&s=$2 [L,QSA]
RewriteRule ^(.
)/image/([^/\]+)$ zp-core/i.php?a=$1&i=$2 [L,QSA]
RewriteRule ^(.*)/album/(thumb|[0-9]{1,4})/([^/\]+)$ zp-core/i.php?a=$1&i=$3&s=$2&album=true [L,QSA]


Catch-all - everything else gets handled in PHP for compatibility.


RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]

RewriteRule ^index.php?album\=(.*)$ $1 [R]

But still not working as I would like to. Should I put it somewhere else in the file?

Administrator
Administrator
acrylian   2009-01-26, 10:57
#7

Assuming that you at least use the latest official 1.2.2 version you should not need to change anything manually in the .htaccess file. Setup should do that for you. Just use the htaccess file that is included in the download package and run setup (which should run automatically though).

Member
Member
lauravink   2009-01-26, 19:26
#8

Ooooohhhh.. it works!
I didn't understand it correctly. I thought I would go to the URL lauravink.in/index.php?album=poland and it would change to lauravink.in/poland.

But I just have to link to the URL lauravink.in/poland and it shows the wright page.

Anyway, thanks for your help acrylian!

Administrator
Administrator
acrylian   2009-01-26, 20:35
#9

[i]I thought I would go to the URL lauravink.in/index.php?album=poland and it would change to lauravink.in/poland.[/i]
Yes, that is what it actually does. The first url is the one without mod_rewrite/htaccess.

Member
Member
mungler   2009-01-27, 19:25
#10

hi lauravink.

just an idea - if you want zenphoto in the root, but not of www.lauravink.com, how about creating a subdomain?

thats what i did with my site - www.mungler.com is the main site (nothing on there yet) and gallery.mungler.com is the zenphoto subdomain. works a treat

Junior Member
Junior Member
darkS   2009-04-16, 01:47
#11

[i]Just a note for anyone that might missed it like me.[/i]
Don't forget to tick 'mod_rewrite' under [b]options > gallery configuration[/b] for these cruft-free URLs.
Careless, I was cracking my head thinking why it wouldn't work and eventually get it right by just a simple few clicks. You don't even need to edit .htaccess

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.