URL Rewrite Enabled and working but does not shorten URL

jweinraub

Joined: 2003-06-13
Posts: 18
Posted: Sat, 2007-11-24 22:03

Please fill out the following form and take a look at the linked pages. The more information you supply, the better we can help you. Remove this FAQ information from your post before submitting.

- What information is required when asking for help in the forums? See:
http://codex.gallery2.org/index.php/Gallery2:faq#What_information_is_required_when_I_ask_for_help_in_the_forums.3F
- You can copy and paste a lot of the required information from "Site Admin" -> "Maintenance" -> "System Information" if your G2 is up and running.
- Also visit http://codex.gallery2.org for: Frequently Asked Questions, Debugging Instructions, Known Issues and much more
- And try your luck with the search function of this website


Gallery version (not just "2"): 2.2
PHP version (e.g. 5.1.6): 5.2.0-8+etch7
PHPInfo Link (see FAQ): http://www.weinraub.net/test.php
Webserver (e.g. Apache 1.3.33): Apache/2.2.3 (Debian)
Database (e.g. MySql 5.0.32): 5.0.32
Activated toolkits (e.g. NetPbm, GD): Ffmpeg, Gd, ImageMagick, NetPBM
Operating system (e.g. Linux): Linux
Browser (e.g. Firefox 2.0): Firefox 2.0.0.2

When I go to administer, the URIs are long, http://www.weinraub.net/gallery2/main.php?g2_view=core.SiteAdmin&g2_return=%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.SiteAdmin%26g2_navId%3Dxfb0394f0&g2_returnName=site+admin&g2_navId=xfb0394f0
rather than short.

...

jweinraub@weinraub:/var/www/html/gallery2$ head .htaccess
# 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
...

jweinraub@weinraub:/var/www/html/gallery2$ ls -al .htaccess
-rw-r--r-- 1 root root 1270 Oct 24 10:46 .htaccess

I am not sure where to go from here. The plugin is enabled and configured. The test does pass for mod_rewrite so i am not sure where to go from here. I searched around and found nothing that can help. So any help is appreciated.

Thanks and regards,
Jonathan Weinraub

Login or register to post comments
valiant

Joined: 2003-01-04
Posts: 32356
Posted: Sat, 2007-11-24 22:06

the module needs to be active.
then you can configure the short URLs at site admin -> URL rewrite.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

Login or register to post comments
jweinraub

Joined: 2003-06-13
Posts: 18
Posted: Mon, 2007-11-26 19:23

It is enabled and running and configured.

Login or register to post comments
jweinraub

Joined: 2003-06-13
Posts: 18
Posted: Wed, 2007-12-05 22:05

Can anybody help me here? I have mod_rewrite enabled. The rewrite plugin is enabled in gallery2 and the htaccess has the appropriate permissions, the short urls are all enabled yet they don't seem to want to work for me. i dont get any errors from the server it seems, it just does not want to work. any suggestions is very much appreciated. thanks so much!!!

Login or register to post comments
MarkRH

Joined: 2007-05-25
Posts: 41
Posted: Fri, 2007-12-07 06:23

From the looks of your .htaccess, none of the URL Rewrite options are actually active.
Look at the Rules tab. You should have a box with a checkmark and a green active icon
next to each option you want enabled.

Login or register to post comments
jweinraub

Joined: 2003-06-13
Posts: 18
Posted: Fri, 2007-12-07 06:32

Okay,

I see that now. However, it still does not work. The htaccess file is now generated and there are green active icons everywhere.

# 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 %{QUERY_STRING} view=core.DownloadItem
    RewriteCond %{HTTP:Referer} !^[a-zA-Z0-9\+\.\-]+://www.weinraub.net/   [NC]
    RewriteCond %{HTTP:Referer} !^$
    RewriteRule .   /gallery2/main.php   [F,L]
    RewriteCond %{QUERY_STRING} g2_view=core.DownloadItem
    RewriteCond %{QUERY_STRING} g2_itemId=([0-9]+)
    RewriteCond %{HTTP:Referer} !^[a-zA-Z0-9\+\.\-]+://www.weinraub.net/   [NC]
    RewriteCond %{HTTP:Referer} !^$
    RewriteRule .   /gallery2/main.php?g2_view=rewrite.DownloadItem&g2_itemId=%1   [L]
    RewriteCond %{QUERY_STRING} g2_view=core.DownloadItem
    RewriteCond %{QUERY_STRING} g2_itemId=([0-9]+)
    RewriteCond %{HTTP:Referer} !^[a-zA-Z0-9\+\.\-]+://www.weinraub.net/   [NC]
    RewriteCond %{HTTP:Referer} !^$
    RewriteRule .   /gallery2/main.php?g2_view=watermark.DownloadItem&g2_itemId=%1   [L]
    RewriteCond %{THE_REQUEST} /gallery2/sitemap(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=sitemap.Sitemap   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/updates(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=dynamicalbum.UpdatesAlbum   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/popular(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=dynamicalbum.PopularAlbum   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/admin/(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=core.SiteAdmin   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/random(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=dynamicalbum.RandomAlbum   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)/slideshowapplet\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=slideshowapplet.SlideshowApplet&g2_path=%1   [QSA,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   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/v/([^?]+)/slideshow\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=slideshow.Slideshow&g2_path=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/c/view/([0-9]+)\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/c/add/([0-9]+)\.html(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=comment.AddComment&g2_itemId=%1   [QSA,L]
    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/rating/([^?/]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=rating.RatingAlbum&g2_limit=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/rss/([^\/\?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=rss.Render&g2_name=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/srss/([0-9]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=rss.SimpleRender&g2_itemId=%1   [QSA,L]
    RewriteCond %{THE_REQUEST} /gallery2/key/([^?/]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=keyalbum.KeywordAlbum&g2_keyword=%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/f/([^?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_controller=permalinks.Redirect&g2_filename=%1   [QSA,L]
</IfModule>

# END Url Rewrite section
Login or register to post comments
Jeremy Toaster

Joined: 2008-03-05
Posts: 14
Posted: Wed, 2008-03-05 04:47

Did you ever figure this out? As I am having the same issue.
Drupal rewrites work, and all the settings in Gallery are saying that rewrites for the gallery are working. I have even turned on and off settings and see that Gallery is writing to the .htaccess file just fine. But Gallery is not rewriting anything in stand alone version and because of that, the embedded version is not working properly either.

Login or register to post comments
jweinraub

Joined: 2003-06-13
Posts: 18
Posted: Wed, 2008-03-05 04:53
Jeremy Toaster wrote:
Did you ever figure this out? As I am having the same issue.
Drupal rewrites work, and all the settings in Gallery are saying that rewrites for the gallery are working. I have even turned on and off settings and see that Gallery is writing to the .htaccess file just fine. But Gallery is not rewriting anything in stand alone version and because of that, the embedded version is not working properly either.

Unfortunately, I haven't. I am not too sure where to go from here, if it is an Apache problem, or something else. I have given up for now, but I will get back to this soon as I have more free time.

Login or register to post comments