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/polandFor 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
Comments
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!
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?
# 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!)
<IfModule mod_rewrite.c>
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]
</IfModule>
But still not working as I would like to. Should I put it somewhere else in the file?
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!
Yes, that is what it actually does. The first url is the one without mod_rewrite/htaccess.
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
Don't forget to tick 'mod_rewrite' under options > gallery configuration 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