[SOLVED] Problem with Gallery module and mod_rewrite

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
vorcan
Forum Members
Forum Members
Posts: 12
Joined: Thu May 19, 2011 7:08 am

[SOLVED] Problem with Gallery module and mod_rewrite

Post by vorcan »

Hello there,

I'm facing problem, described in title. Whenever I turn pretty urls on (using mod_rewrite), my Gallery module stops to work completely. I cannot display any gallery nor can I acces any subgalleries. When I click on any gallery, the page gets refreshed, instead of directing me inside the gallery.

Whole problem disappears when pretty urls are turned off. Does anyone know what can be the reason and how to fix it?

I'm using 1.9.4.3 CMS version (no, I cannot upgrade cause, since whole page was built when there was no 1.10, I would have to upgrade/make changes in several modules in order to make everything work and having pretty urls is definetly not worth it). Here's the code of mod_rewrite:

.htaccess file:

Code: Select all

Options +FollowSymLinks
  RewriteEngine on
  RewriteBase /
 
  # 301 Redirect all requests that don't contain a dot or trailing slash to
  # include a trailing slash
  # except for form POSTS
  RewriteCond %{REQUEST_URI} !/$
  RewriteCond %{REQUEST_URI} !\.
  RewriteCond %{REQUEST_METHOD} !POST$
  RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
 
  # Rewrites urls in the form of /parent/child/
  # but only rewrites if the requested URL is not a file or directory
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)$ index.php?page=$1 [QSA]

and config.php file:

Code: Select all

 #------------
  #URL Settings
  #------------

  #What type of URL rewriting should we be using for pretty URLs?  Valid options are:
  #'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
  #configurations. 'mod_rewrite' requires proper apache configuration, a valid
  #.htaccess file and most likely {metadata} in your page templates.  
  $config['url_rewriting'] = 'mod_rewrite';

  #Extension to use if you're using mod_rewrite for pretty URLs.
  $config['page_extension'] = '/';

  #If you're using the internal pretty url mechanism or mod_rewrite, would you like to
  #show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
  $config['use_hierarchy'] = true;

  #If using none of the above options, what should we be using for the query string
  #variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
  $config['query_var'] = 'page';
Would be really grateful if anyone could tell me how can I make it work.

Thanks in advance.
Last edited by vorcan on Thu Dec 01, 2011 1:07 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Problem with Gallery module and mod_rewrite

Post by Jos »

Do you have a {metadata} tag in your page template?
vorcan
Forum Members
Forum Members
Posts: 12
Joined: Thu May 19, 2011 7:08 am

Re: Problem with Gallery module and mod_rewrite

Post by vorcan »

Hello there Jos and thanks for your interest.

Yes, I have the tag. To be sure I even copied/pasted the part of the <head> from other templates to gallery's one. Nothing changed.

I checked all browsers and the problems occurs in each of them. However, i noticed something else. When I try to enter any of the galleries the sites gets refreshed as I wrote above, but there is some change. At adress bar. It adds correct adrress of particular gallery, containing it's name (like if I entered it). So I came into conclusion that there must be some problem with architecture of my gallery.

On my site, I made a model which uses main gallery (default one, called Gallery/) as a content of Gallery subsite (archieved it by putting {Gallery} tag directly into code). This way, content of "Comment" field at Gallery's panel is the actual content of Gallery subsite and all of subgalleries of the main, parent one - Gallery/ are the actual galleries displayed at the site (prev, next and jakis).

I would to ask whether there might be something wrong with such representation and use of this module. You can see the site by visiting www.mkslubartow.pl (since it's up already) and see how does it look like. Pretty URLs are turned on currently.

Hope that my explaination isn't too complicated.

Regards,
Dave
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Problem with Gallery module and mod_rewrite

Post by gianpiero »

I have a gallery version 1.4.4 on my 1.9.4.3,
I don't use this way, but I can try for you.


What's your module version ?

One more: I ask you the reason of number "60" into web address, that appear like:

http://mkslubartow.pl/gallery/jakis/60/
http://mkslubartow.pl/gallery/next/60/
http://mkslubartow.pl/gallery/prev/60/


bye
/gp
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Problem with Gallery module and mod_rewrite

Post by Jos »

Seems to me as if you don't have a {content} tag in your template for the "Galeria" page?

Gallery needs the {content} tag in mod_rewrite mode to display the module-output.

I always use the regular template, and just put the {Gallery} tag in the content field of the page. Are you able to try it that way?
gianpiero
Forum Members
Forum Members
Posts: 221
Joined: Sun Jan 07, 2007 4:32 pm

Re: Problem with Gallery module and mod_rewrite

Post by gianpiero »

sorry I asked this unuseful information
I ask you the reason of number "60" into web address
I tested {gallery} with some {subgallery} working regular into my site
with url rewriting.
vorcan
Forum Members
Forum Members
Posts: 12
Joined: Thu May 19, 2011 7:08 am

Re: Problem with Gallery module and mod_rewrite

Post by vorcan »

@jos: this explains everything:

Code: Select all

Gallery needs the {content} tag in mod_rewrite mode to display the module-output.
Indeed, I didn't have {content} tag at my gallery site's template. I didn't know that there is a need for it in order to mod_rewrite work.

Anyway, there is no diffrence between putting {gallery} tag directly in code and putting in in the content field of {content} module. I made it the second way and everything works perfectly.

I feel kinda weird now for wasting your time for so low-based reason. I should have think about such solution. It wasn't that hard afterall. Thank you so much for giving me that tip :)

@gianpiero: Thank you for showing your will to help me in this issue. Furtunetly, Jos has already brought me a solution to this one. And to be honest, I don't have single idea what the number you asked about is :)

Thank you once more, have a nice day.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Problem with Gallery module and mod_rewrite

Post by Jos »

vorcan wrote:I feel kinda weird now for wasting your time for so low-based reason. I should have think about such solution. It wasn't that hard afterall. Thank you so much for giving me that tip :)
No problem, that's what I am here for.


And to answer the question about the trailing number: that represents the page-id in which the module output should be displayed.
Post Reply

Return to “Modules/Add-Ons”