We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39426
    • 15 Posts
    Hi everyone,
    you can read my general problem in this title. I have a base URL problem with my two contexts and I don't know what I can do.

    My versions:
    - MODX Revolution 2.2.13-pl (traditional)
    - Gallery 1.6.1-pl

    My contexts:
    - main context "web" with language "de" (german) - accessible with first level domain: traumfinsternis.de
    - second context "en" with language "en" (english) - accessible with fld + subfolder: traumfinsternis.de/en

    My htaccess:

    # The Friendly URLs part
    # redirect all requests to /en/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(de|en)/favicon.ico$ favicon.ico [L,QSA]
       
    # redirect all requests to /en/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(de|en)/assets(.*)$ assets$2 [L,QSA]
      
    # redirect all other requests to /en/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(de|en)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


    So you see I wanted to create only a subfolder for my second language site. And I think that is the problem. My context settings for "en" are:
    base_url: {base_url}/en/
    site_url: {site_url}/en/

    Everything works fine (navigation, taglister and so on), but only the Gallery snippet causes problems. No image will be displayed at the english frontend. I wanted to show the same gallery in both contexts.


    I found out that the URL at "en" is wrong in the source code. It seems that the system take the en base URL to display the image. But this folder/data doesn't exist.

    This URL works in original web context frontend:
    /assets/components/gallery/connector.php?action=web/phpthumb&ctx=web&w=900&h=100&zc=0&far=&q=100&src=%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F9%2F303.jpg

    And this URL in "en" dosn't:
    /assets/components/gallery/connector.php?action=web/phpthumb&ctx=en&w=900&h=100&zc=0&far=&q=100&src=%2Fen%2F%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F9%2F303.jpg


    So, I tried to change the "en" base_url context setting from {base_url}/en/ to {base_url} and then the gallery works fine. But my "en" home page causes this error now:

    Error: redirection error
    The site is redirecting the request in a way that it can never be completed.


    It will work again when I changed the base_url setting to my default.

    When I change in the system settings the Gallery paths to an absolute URL (http://traumfinsternis.de/...) then I get a phpThumbOf error instead of the image.


    Do you know how I can solve this problem?

    Thanks in advance!

    Greets,
    Isabel

    This question has been answered by dracovina. See the first response.

    [ed. note: dracovina last edited this post 12 years, 6 months ago.]
      • 39426
      • 15 Posts
      Has anybody an idea how to solve this?
      I'd like to start with my english website, but without galleries I can't :-(
      • discuss.answer
        • 39426
        • 15 Posts
        Solved quick and dirty:

        I set an output filter (replace) to the image/thumbnail value:

        Gallery chunk tpl for image item:

        <img src="[[+image]]" alt="Traumfinsternis - Header" />


        With output filter to remove the wrong path part:

        <img src="[[+image:replace=`%2F%2Fen%2F%2F==%2F`]]" alt="Traumfinsternis - Header" />


        Now it works, but I think it is not the best solution. I don't know another way. If you know the right one, it would be great to post it here. Thanks!
          • 36613
          • 328 Posts
          I resove with this component "pthumb" the application is:
          <img src="[[+image_absolute:pthumb=`w=1920&h=382&zc=1`]]" alt="[[+name]]" alt="[[+name]]" />
            • 36446
            • 184 Posts
            Quote from: cristianb88 at Nov 25, 2014, 12:40 PM
            I resove with this component "pthumb" the application is:
            <img src="[[+image_absolute:pthumb=`w=1920&h=382&zc=1`]]" alt="[[+name]]">
            thanks! helped and worked!
              https://www.beautyislife-shop.de - premium make-up!
              https://www.topsterne.de - sell it here!
              ---------------------------------------------------------