Need .htaccess for mod_rewrite for G1>G2 migration...

WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sat, 2012-04-07 05:31


G2 URL (optional): http://gallery2.opalcat.com/gallery2
G2 version: 2.3.1 core 1.3.0.1
G1 URL (optional): http://gallery.opalcat.com/gallery
G1 version: "This version of Gallery was released on 08/16/07" 1.5.something
G1 character set: ???
PHP memory limit: Not sure
--
PHP version (e.g. 5.1.6):5.2.17 cgi-fcgi
PHPInfo Link (see FAQ): http://gallery2.opalcat.com/gallery2/phpinfo.php
Webserver (e.g. Apache 1.3.33): Apache
Database (e.g. MySql 5.0.32):mysqli 5.1.62-community-log, lock.system=flock
Activated toolkits (e.g. NetPbm, GD): ArchiveUpload, Exif, Getid3, ImageMagick, LinkItemToolkit, NetPBM, Thumbnail, Gd
Operating system (e.g. Linux):Linux host180.hostmonster.com 2.6.32-46.1.BHsmp #1 SMP Tue Sep 6 12:18:02 MDT 2011 x86_64
Browser (e.g. Firefox 2.0): Google Chrome 17.0.963.79 m

I actually did this migration a few years ago...but I never finished up with making the G1>G2 mod_rewrite thing so I could remove my g1 stuff and have it all forward correctly... but I looked in the database and the migration map is there, so I just need to figure out how the .htaccess file should read. The problem is that I moved the gallery from one subdomain to another subdomain... though the actual files are in folders in the same public_html folder on my server.
The old gallery 1 was at http://gallery.opalcat.com/gallery/ (path is /home/myusername/public_html/opalcatgallery/gallery)
The new gallery 2 is at http://gallery2.opalcat.com/gallery2/ (path is /home/myusername/public_html/opalcatgallery2/gallery2)

The .htaccess file in my gallery2 folder is this:

# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /gallery2/

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   -   [L]

    RewriteCond %{THE_REQUEST} /gallery2/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [$
    RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)\.davmount(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=webdav.DownloadDavMount&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/w(/[^?]*)?(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_controller=webdav.WebDav&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_controller=migrate.Redirect&g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section

if that's any help...
--
WebKat, Gallery2 holdover extraordinaire.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-04-08 18:37
 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sun, 2012-04-08 18:44

It isn't helpful at all. I already did all that up to the .htaccess part. I HAVE NO IDEA what to put in the .htaccess file. I can barely understand--no make that I can't understand what I see in most mod_rewrite .htaccess files that other people have written. The concept that I would be able to craft such a file is so ludicrous as to be beyond the realm of even my sense of humor.

--
WebKat, Gallery2 holdover extraordinaire.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2012-04-08 19:33

I don't see anything in the instructions asking anyone to craft any files.
The concept of the Gallery Project Devs asking people to self craft such a complicated file is so ludicrous that the thought that you could even consider it a possibility is staggering.

Perhaps it is a language thing, but what this statement: "Basically, you need to add a .htaccess file with the contents as shown on that page in your Gallery 1 albums/ folder" says to me is ...

1. You create a text file on your local machine
2. You copy the htaccess contents from the "Site Admin -> Import: Gallery 1" page
3. You paste these contents into this new file
4. You save the file in your "gallery1/albums" folder as ".htaccess"

--
dakanji.com

 
WebKat
WebKat's picture

Joined: 2002-11-22
Posts: 182
Posted: Sun, 2012-04-08 22:01

THAT'S where it was. I knew I'd seen the clip of code for the .htaccess file somewhere, but for the life of me I could not recreate the situation to show it again. I figured I'd missed my chance to see and grab it once I finished the migration. Thanks.

[/b]By the way, does anyone else get (/b]B every time they type a capital B and (/i]I every time they type a capital I in the Post new comment window? (with a [ instead of a [ of course)? It's really weird.
--
WebKat, Gallery2 holdover extraordinaire.