We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: worchyld at Oct 17, 2007, 06:30 AM

    1. How do you ensure ’Use friendly alias path’ actually works in both the address bar and primary navigation
    2. How to ensure that using friendly alias path does not effect hyperlinks pointing to hidden containers/pages/folders
    1. They just work or they don’t.
    2. What do you mean by "hidden" containers/pages/folders? If you enable friendly_alias_paths, then all containers will be considered in the building of the URL structure of it’s children. If by hidden you mean stuck in an unpublished folder, then there is no solution; if by hidden you simply mean they are pages not listed in the menus (i.e. show in menu is not checked), then all should be well.
      • 32645
      • 377 Posts
      Hi there!


      Quote from: worchyld on Today at 06:30 AM
      1. How do you ensure ’Use friendly alias path’ actually works in both the address bar and primary navigation
      2. How to ensure that using friendly alias path does not effect hyperlinks pointing to hidden containers/pages/folders
      ...

      1. They just work or they don’t.
      2. What do you mean by "hidden" containers/pages/folders? If you enable friendly_alias_paths, then all containers will be considered in the building of the URL structure of it’s children. If by hidden you mean stuck in an unpublished folder, then there is no solution; if by hidden you simply mean they are pages not listed in the menus (i.e. show in menu is not checked), then all should be well.

      1. I got the friendly URLs to appear now in both address bar and primary navigation.
      The problem is that child links no longer resolve (ie: any child page never displays)

      2. Hidden containers/folders/pages.

      I mean any page where you say "Show in menu" and its not checked. Everything is published.

      I have a hyperlink which redirects to a page where the "show in menu" option is not checked.

      All that happens is that I click on a hyperlink/MODX created weblink in my primary menu and it goes back to the homepage.

      I’ve even tried inserting Site_url into the link, but all that happens is it goes back to the homepage.

      In the primary menu (created by wayfinder), do I need to pre-fix anything other than site_url?

      Maybe there’s a new HTaccess file or setting that I’m not aware of? I’ll post my htaccess here;

      # MODx supports Friendly URLs via this .htaccess file. You must serve web
      # pages via Apache with mod_rewrite to use this functionality, and you must
      # change the file name from ht.access to .htaccess.
      #
      # Make sure RewriteBase points to the directory where you installed MODx.
      # E.g., "/modx" if your installation is in a "modx" subdirectory. If you have
      # problems with your .htaccess working at all, try un-commenting the first 
      # line above the "RewriteEngine On" directive.
      #
      # You may choose to make your URLs non-case-sensitive by adding a NC directive
      # to your rule: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,NC]
      
      Options +FollowSymlinks
      RewriteEngine On
      RewriteBase /
      
      
      # ------------------------------------------------------
      
      # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
      #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
      #
      # or for the opposite domain.com -> www.domain.com use the following
      # >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
      #
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
      #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
      
      
      
      # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
      # https://www.domain.com when your cert only allows https://secure.domain.com
      #RewriteCond %{SERVER_PORT} !^443
      #RewriteRule (.*) https://example-domain-please-change.com.com/$1 [R=301,L]
      
      
      
      # The Friendly URLs part
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      # RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      RewriteRule ^([^/]*)/?(.*)$ index.php?q=$1 [L,QSA]
      
      
      
      # Make sure .htc files are served with the proper MIME type, which is critical # for XP SP2. Un-comment if your host allows htaccess MIME type overrides.
      
      #AddType text/x-component .htc
      
      
      
      # If your server is not already configured as such, the following directive
      # should be uncommented in order to set PHP's register_globals option to OFF.
      # This closes a major security hole that is abused by most XSS (cross-site
      # scripting) attacks. For more information: http://php.net/register_globals
      #
      # To verify that this option has been set to OFF, open the Manager and choose
      # Reports -> System Info and then click the phpinfo() link. Do a Find on Page
      # for "register_globals". The Local Value should be OFF. If the Master Value
      # is OFF then you do not need this directive here.
      #
      # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
      #
      # Your server does not allow PHP directives to be set via .htaccess. In that
      # case you must make this change in your php.ini file instead. If you are
      # using a commercial web host, contact the administrators for assistance in
      # doing this. Not all servers allow local php.ini files, and they should
      # include all PHP configurations (not just this one), or you will effectively
      # reset everything to PHP defaults. Consult www.php.net for more detailed
      # information about setting PHP directives.
      
      #php_flag register_globals Off
      
      
      
      # For servers that support output compression, you should pick up a bit of
      # speed but un-commenting the following lines.
      
      #php_flag zlib.output_compression On
      #php_value zlib.output_compression_level 5
      
      
      
      # The following directives stop screen flicker in IE on CSS rollovers. If
      # needed, un-comment the following rules. When they're in place, you may have
      # to do a force-refresh in order to see changes in your designs.
      
      #ExpiresActive On
      #ExpiresByType image/gif A2592000
      #ExpiresByType image/jpeg A2592000
      #ExpiresByType image/png A2592000
      #BrowserMatch "MSIE" brokenvary=1
      #BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
      #BrowserMatch "Opera" !brokenvary
      #SetEnvIf brokenvary 1 force-no-vary
      



      ...

      I might give up on this, or try it with a clean install starting from scratch as I’ve already spent too long trying to make it work.
        • 22303 MODX Staff
        • 10,725 Posts
        Not sure where you got this RewriteRule, but that is definitely not going to work:
        RewriteRule ^([^/]*)/?(.*)$ index.php?q=$1 [L,QSA]

        You need the original rewrite rule.
          • 32645
          • 377 Posts
          Hi there.

          The rewrite rules were in the MODX installation.

          EDIT: Sorry what I meant was the rewrite rules were from an old modx hack, sorry!

          But I want to thank you very much for your help! I really appreciate it!

          I will try your new Rewrite rules and work from there.
            • 32645
            • 377 Posts
            I’ve got it to work now. With exception of web links

            I got rid of the offending rewrite rule and reintroduced;

            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
            


            But the one outstanding issue is how MODX created weblinks are handled.

            Here’s an illustration of what I’m trying to do;


            Home
            Latest news <-- This is a weblink to the following page
            - News
            - News story 1
            - News story 2
            - etc

            I am doing it this way because my primary menu shows all submenus for every item in the primary menu, and there are some pages where I don’t want it to show subpages, like news. Now the way I solved this was to have a weblink that simply jumps to the news page without it listing every news article in the left hand side.

            There is another page which is similar. A link called "Some Story" jumps to the first child page.

            In both instances what happens is I click the link and it takes you to the homepage.

            The only way I’ve seen to solve this is to force the web hyperlink to jump to the actual child page by saying the full path you want to go to.

            ie:

            Weblink to news story 1 would be: /latest-news/news/story1 etc.





              • 32645
              • 377 Posts
              I’ve got everything to work now!

              YIPPIE!

              With weblinks, whether they be MODX generated (in the manager) or otherwise they should have the full-path (ie: /parent/child) and not just (/child) otherwise it will just redirect to the homepage.

              Coupled with the correct htaccess rules, everything does work fine! Thank god!

              Thanks a lot, I appreciate your help!
                • 23058
                • 17 Posts
                I’m looking for the file where I can change words. I mean I’ve a subcategory called "This & That" (OK, that’s not a real name of my subcategory but it also includes the "&") and the "&" (ampersand) is translated into an "and" in the URL. The result is "This_and_That.html" Because english is not the site’s language I need to translate / change some specific words. Where can I find them?

                //EDIT
                Found it. It was the Alias-thingy.
                  • 10164
                  • 27 Posts
                  Hey guys
                  i have recently changed to using FURLs and everything seems to be fine, the site is working and the alias paths are correct. but my site has a directory which is password protected via cPanel , this was working fine until i did the FURLs , now the link to this directory just wont work, i am using linux, apache, modx 0.9.6
                  the link to the protected directory is like this. www.mysite.com/documents/index.html
                  any ideas why the mod rewrite has stopped access to this folder?
                  thanks in advance smiley
                    • 22303 MODX Staff
                    • 10,725 Posts
                      • 6595
                      • 20 Posts
                      ive edited my .htaccess file and done all the necessary changes to the modx config. however when i go to my site and type in a url without html at the end, the page comes up.but if i type in say for example "product.html" a 404 error comes up.can any1 tell me whats up?the pages seem to be linking alrite but the suffix doesn’t appear at the end of the url.and yes before u ask, I do have it set to ".html".

                      This discussion is closed to further replies. Keep calm and carry on.