URL Rewrite paths.
meow
Joined: 2006-12-19
Posts: 26 |
Posted: Mon, 2007-01-29 20:54 |
OK, mod_rewrite with Apache works, I have everything installed perfectly. For my Gallery 1 I used to have real nice short clean URLS like: http://domain.nl/albumname/imagename and you would get the page with the sized image, and that was it! My /albums folder was at the domain root for G1 How do I configure URL Rewrite to use the same short URLs for In the URL Rewrite plugin config I see the Migration G1 > G2 What do I do? G2 version is 2.2 RC1, and Apache gets to rewrite via htaccess. PHP 4.4.4 Bandwidth theft and image-stealing is fine with me. Thanks in advance. |
|
Posts: 32509
please read:
http://codex.gallery2.org/index.php/Gallery2:migration#Preserving_Gallery_1_URLs
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 26
I already did, but it does not answer my question(s). At all.
Again: I want to have my URLs (so also the NEW ones) exactly like before,
furthermore, I prefer to have my image-files in the same locations, as actual files.
The config screen does not let me do that, because I cant enter
%path% and %path% in two of the boxes at the same time.
In fact, G2 asks me to put the actual files in an unreachable location,
which I do not understand, since Im putting imagefiles online in order
to get them seen, I dont care about them not being available,
Im making them available for a reason: They should be seen,
preferably even indexed by google.
G2 also makes the endings in the form of filename.jpg.html
while in my G1 install I had them as filename
(and nothing after it). Can I get rid of that .extension.extension addition?
Posts: 32509
unlike gallery 1, all gallery 2 URLs start with the gallery 2 folder. there's o web-accessible albums/ folder in g2.
that's considered a feature. in g1, anyone could download / view your images, even if you didn't give them access to since the albums/ folder was web-accessible.
> They should be seen, preferably even indexed by google.
g2 is not stopping search engines from indexing your pages and images and it's not stopping your visitors from viewing your images.
> I cant enter %path% and %path% in two of the boxes at the same time.
true. that's a limitation of the url rewrite module.
by some custom mod_rewrite rules in the albums/ folder that you want you could achieve what you want. image urls starting with albums/.
but you'd also have to slightly modify g2's url generator such that it generates such urls for images.
this involves php coding, there's no such configuration setting.
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 26
OK, so why use the URL Rewrite mapping option at all then?
It seems to me it is doing something very stressful for the webserver, if I keep the Migration plugin enabled at all times. G1 is such a relief compared to how all this is done in G2. It all sounds way too complex and workaround-ish to me.
Here's what I would prefer instead:
- To not use ANY G1 > G2 URL mapping, let Google etc. index all of the images anew.
( Make the 404 go to the index of the gallery, so not found images can be found again via the main index.)
- To make the View image URL as short as possible, i.e. %path% for the main G2 URL.
Even when I'm not using G1>G2 mapping, I still can't get the %path% entry in there.
- Make the actual gallery data root the same as the G2 install root, so that folder
/albums/ is in the same physical location as it was before, and most jpg/png/gif etc.
are at the exact same location, so many direct links will still work. Only those for subalbums are now 1 directory deeper (as I've seen G2 do it now).
The security issue is a non-issue for me: I'm not running a gallery to hide stuff, I'm running it to publish stuff. ;-) In that I don't really care how people access my content. If it's through remote direct links, or fancy-index httpd folders, that's fine with me. Most of them I block through SetEnv entries anyway.
Posts: 32509
> It all sounds way too complex and workaround-ish to me.
what workaround?
one of the goals of g2 was true access control. you can't achieve it without controlling file access through the application.
you're the first user to complain that you preferred if image URLs wouldn't start with the gallery/ folder.
and compared to g1, g2 has to deal with backwards compatbility with G1 urls. that's why it needs that g1->g2 url redirection rule.
> - To not use ANY G1 > G2 URL mapping, let Google etc. index all of the images anew.
then don't enable that url rewrite rule
> - To make the View image URL as short as possible, i.e. %path% for the main G2 URL.
works for me. but as mentioned earlier, currently you can't have more than 1 rule with the same pattern. so you have to disable another rule with the same pattern before you can change the view pattern this way.
> - Make the actual gallery data root the same as the G2 install root, so that folder /albums/ is in the same physical location as it was before,
while you can't do this in a physical way, you can use URL rewrite and some minor code changes to make URLs look like that.
--------------
Enter the Gallery 2 Theme Contest today!
Posts: 26
> > - Make the actual gallery data root the same as the G2 install root,
> > so that folder /albums/ is in the same physical location as it was before,
> while you can't do this in a physical way, you can use URL rewrite and some minor code changes to make URLs look like that.
Seems to me I can do this. I just give the data folder the absolute path of the gallery root dir. Sure, I might have to take out 1 htaccess file, but that's not a problem for me.
Posts: 1
I completed the G1 --> G2 Migration guide and installed g2 in the same directory in which G1 was installed.
- during the install everything was fine with no errors
- I kept the g1 -> g2 links when importing albums
- turned on URL Rewrite and enabled the G1->G2 Mapping rule.
- when i did a search on google my old links looked like this
- http://djvibe.com/gallery/view_photo.php?set_albumName=tiesto01&id=DCP01207
- these come back 404 errors
- I would like help writing a custom .HTACCESS rewrite that strips the PHP and variables from the link that results in this style
- http://djvibe.com/gallery/tiesto01/DCP01207
- which works fine..
any help would be much appreciated..
cheers,
Graham