mod_rewrite / WPG2 ISSUES?!
cmulder
Joined: 2007-08-12
Posts: 3 |
Posted: Thu, 2007-10-25 09:36 |
I've been having problems with configuring the mod_rewrite module to work with my Gallery (2.2.2) which is embedded into Wordpress (2.2) with the help of the WPG2 plugin. Because of linked logins between Gallery2 and Wordpress, I have to be logged into the Wordpress backend to enter the Gallery2 backend. If I'm not logged into the wordpress backend and I go to the Gallery admin section, it says 'Security Violation... action not permitted'. No problem, just a little background info. So my gallery installation is located at '/gallery2' I would like to use the mod_rewrite plugin to have my site's gallery to be at '/images/...' with shortened urls. After setting the mod_rewrite plugin in the Gallery2 backend, pictures would not load and attempts view albums display 404 errors. I attempted to login to the backend and reconfigure the plugin... but this time, even when logged into the Wordpress backend, I couldn't get in to the 'Site Admin' section no matter how I tried. When I click on 'Site Admin' it redirects me back to my site where I had specified the new 'rewritten' admin url to be in the plugin settings, which is '/images/admin'. This gives a 404 error. So, I'm locked out of my site admin and thus can't deactivate the mod_rewrite plugin. I tried the following instructions to turn off the plugin: Quote:
* G2's URL rewrite module is active but doesn't work correctly. Fîx: So i put it in maintenance mode, tried the link, and it says I'm not logged in and gives an 'Admin Login' link... which of course redirects me back to my site where I had specified the new 'rewritten' admin url to be in the plugin settings, which is '/images/admin'. Again, this gives a 404 error. So I then tried this section: Quote:
If the login view doesn't work, you can try to login manually with http://www.example.com/gallery/main.php?g2_controller=core.UserLogin&g2_form[formName]=UserLogin& g2_form[action][login]=Login&g2_form[username]=admin&g2_form[password]=secret (replace "secret" with your own password) I was able to login, but when I click on 'Site Admin' it once again redirects and gives a 404 error. I've also tried directly editing my gallery2 directory's .htaccess file, to no avail. I'm an apache newbie. Here's what my butchered htaccess looks like after I tried to edit it... any help? Quote:
RewriteEngine On At this point, I'd be happy just with deactivating the plugin and thus getting the login and images working again, and settling for messy links. But it sure would be nice to get the plugin working :D Thanks in advance!
|
|
Posts: 492
Just for the record, we did warn about not using the admin rewrite:
Now, let's see about getting you back into your site.
If you use phpmyadmin, you can go to your G2 database, then click on the g2_pluginparametermap table in the left column. Click "Search" at the top of the right window, and then scroll down to the bottom of the search page and enter activeRules in the g_parameterName search box.
Once on the correct record, click the edit button (the pencil to the left of the record). In the resulting window, look at the "Value" pane. You should see something like this:
Note that the admin rule is at the end of the list from my dev box. Replace all of that with
Now, click "Search" again and enter shortUrls in the g_parameterName search box.
Again, replace all of that with
Then go to the WPG2 Gallery2 Rewrites tab. Turn off rewrites and then turn them back on. You'll get an error at the top of the screen saying that a variable isn't an array. That's no problem. Your rewrite rules should be reset to the defaults, which do not include the Site Admin rule.
I tested this on my dev box and it worked. Please let me know if it works for you.
Thanks,
Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website
Posts: 3
First, I followed the instructions, but couldn't login to access the plugin area to deactivate the mod_rewrite plugin, just got the same resulting redirect and 404 error
So i tried in maintenance mode again and to deactivate the plugin manually:
and it displayed this:
So then after a few errors when trying to visit my gallery or login:
I started to write this post, then checked the situation again and the rewrite plugin was successfully deactivated! Thus, the admin link redirect isn't working anymore and I was able to login! I went to plugins and re-activated the URL rewrite plugin, and YES, the settings are all back to default.
I wish there was a 'gratitude' smiley!!!
Thank you!!!
Gallery version : 2.2.2 Minimal
PHP version : 4.4.7
Webserver : Apache 1.3.37 (Unix)
Database : MYSQL 5.0.27-standard
WORDPRESS GALLERY2 LINK: http://sonechko.burbur.us/images.php
Posts: 492
Great! Glad it worked in the end.
Just for anyone else reading this thread, you can enable and disable Gallery2 URL rewrites from the WordPress admin panel under WPG2 -> Gallery2 Rewrites. This keeps you out of the loop where you can't get to the G2 Site Admin, because the link is to a broken rewrite rule.
Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website
Posts: 56
Hi, Am having the similar issues
This is the first time i used the wpg2. After enabling the gallery2 rewrite in wordpress setting, my gallery is broken. it doesn't show the photos nor am able to login to admin pages.
but Randomimage link is working fine. [i]I tried running the following url:
http://www.mysite.com.com/g2/main.php?g2_view=core.PluginCallback&g2_pluginId=rewrite&g2_pluginType=module&g2_command=deactivate
it shows messages as {"status":"error"}
Could you pls help me out..