We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37317
    • 77 Posts
    Hi,

    I have a site that is using Gallery add-on.
    I had someone help me from the forum writing the re-write rule for it so i can view in url friendly way.

    this is the orginal url:
    shaysamia.com/portfolionew.html?galAlbum=Ariana

    this is what i want it to look like:
    shaysamia.com/portfolionew/Ariana/

    This is part of mu rewrite rule:
    RewriteRule ^portfolionew/([^_]*)$ /index.php?q=portfolionew&galAlbum=$1 [L]

    It is not working for :
    shaysamia.com/portfolionew/Ariana/

    help?

    thanks
      • 3749
      • 24,544 Posts
      Would it work to just change the container suffix in System Settings?

      Otherwise, try this:

      RewriteRule portfolionew\.html?$ portfolionew/  [L]



      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODx info for everyone: http://bobsguides.com/MODx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 37393
        • 68 Posts
        Try this:

        RewriteRule ^portfolionew/Adriana/$ portfolionew.html?galAlbum=Adriana [NC]


        or if you wish to rewrite all pages in that directory:

        RewriteRule ^portfolionew/(*.)$ portfolionew.html?galAlbum=$1 [NC]




        [ed. note: bowkilled last edited this post 14 years, 9 months ago.]
          IntoVPS - VPS hosting service with super-fast response.
          If MODx does not suit your needs then you have a lack of imagination.
          • 37317
          • 77 Posts
          hi...

          BobRay: I tried the rewrite u sent me, but it is not working.

          Bowkilled: Also tried urs, but i get an internal server error, therefore I removed it.

          This is what i have in my htaccess file in regards to url friend:
          # The Friendly URLs part
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
          RewriteRule ^portfolio/([^/]+)/$ index.php?galAlbum=$1 [L,QSA]
          #RewriteRule ^portfolionew/([^_]*)$ /index.php?q=portfolionew&galAlbum=$1 [L]
          


          The last line i commended it since it is not working.

          my url should eventually be:
          http://shaysamia.com/portfolionew/xxx/

          which is equivalent to:
          http://shaysamia.com/portfolionew.html?galAlbum=xxx


          any ideas?

          thanks again.
            • 33968
            • 863 Posts
            I think you were pretty close with that last line - you do need the 'q=' parameter.

            Just guessing here:
            # The Friendly URLs part
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^portfolio/([^/]+)/$ index.php?q=portfolionew&galAlbum=$1 [L,QSA]
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            
              • 3749
              • 24,544 Posts
              I think my rule would work, but you'd have to put it above the MODX rule and remove the [L].
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 37317
                • 77 Posts
                thanks again guys, but no luck.

                lucas: if i put your code, i get page not found in portfolionew.

                bobray: if i put yours, it doesn't handle the "xxx".

                here is my updated code:
                # The Friendly URLs part
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                #
                # all pages of website
                RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                #
                # used for the current portfolio: example: http://www.shaysamia.com/portfolio/conceptual/
                RewriteRule ^portfolio/([^/]+)/$ index.php?galAlbum=$1 [L,QSA]
                #
                # used for NEW portfolio: example: http://www.shaysamia.com/portfolionew/Ariana
                #RewriteRule ^portfolionew/([^/]+)/$ index.php?q=portfolionew&galAlbum=$1 [L,QSA]
                #RewriteRule portfolionew\.html?$ portfolionew/  [L]


                can i send u guys my u & p to the htaccess via PM?
                  • 37317
                  • 77 Posts
                  hello?
                    • 3749
                    • 24,544 Posts
                    Let's back up, if you enter this URL in the browser, does it take you to the right place?

                    shaysamia.com/portfolionew/Ariana/


                    ---------------------------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                    MODx info for everyone: http://bobsguides.com/MODx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 37317
                      • 77 Posts
                      Bob, no.
                      It takes me to the current homepage.