We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40212
    • 4 Posts
    My website is setup in the following manner:

    www.example.com/modx

    With .htaccess I was able to get the url below working:

    www.example.com

    ------

    Here is the challenge ... Wayfinder is generating MENU LINKS in the form of:

    www.example.com/modx/news

    Is it a Wayfinder issue? Or a .htaccess issue? Or a System setting issue?

    I do NOT want generated links to EVER show the /modx directory ...

    Because www.example.com/news works fine.

      • 40212
      • 4 Posts
      Also I want to suppress all visibility of the modx directory in the url bar
        • 19369
        • 1,098 Posts
        Quote from: xamalek at Jun 19, 2012, 04:30 AM
        Is it a Wayfinder issue? Or a .htaccess issue? Or a System setting issue?

        Make sure you have this code in the head tag of your page:
        <base href="[[!++site_url]]" />


        Then make sure you have the correct "RewriteBase" setting on .htaccess:
        RewriteEngine On
        RewriteBase /modx/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


        Finally, check that the system settings are configured properly (see step 2).

          • 40212
          • 4 Posts
          First let me say thanks for such a detailed response.

          1. Does this code
          <base href="[[!++site_url]]" />


          tell the system to NOT cache the site_url ... correct?

          2. How many .htaccess files do I need. Do I need one at the /public_html level and one at the /public_html/modx level (for the Friendly URLS)?


          Quote from: microcipcip at Jun 19, 2012, 07:59 AM
          Quote from: xamalek at Jun 19, 2012, 04:30 AM
          Is it a Wayfinder issue? Or a .htaccess issue? Or a System setting issue?

          Make sure you have this code in the head tag of your page:
          <base href="[[!++site_url]]" />


          Then make sure you have the correct "RewriteBase" setting on .htaccess:
          RewriteEngine On
          RewriteBase /modx/
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


          Finally, check that the system settings are configured properly (see step 2).

          [ed. note: xamalek last edited this post 14 years, 4 months ago.]
            • 19369
            • 1,098 Posts
            Quote from: xamalek at Jun 19, 2012, 10:08 AM
            First let me say thanks for such a detailed response.

            1. Does this code
            <base href="[[!++site_url]]" />


            tell the system to NOT cache the site_url ... correct?

            No, sorry I should have explained it better. Excerpt from MODX Documentation:
            If your site is using friendly URLs, then it is recommended to add following line in the head sections of your template ....(code here) .....This will ensure that snippets and modules that reference $base_path behave correctly. Also, adding the base href will help in process of migration of site from one host to another, as the setting can be changed easily and it ensures that relative URLs keep working.


            2. How many .htaccess files do I need. Do I need one at the /public_html level and one at the /public_html/modx level (for the Friendly URLS)?

            Just one on /public_html/modx/

            Note: this will make the url behave correctly but will not remove "modx" from the url itself. Try to search on google something like this "modx remove folder htaccess" for fixing this.
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              An additional note: Don't name your MODX install folder "modx". If you give the folder a unique name, it's hard to know for sure that you've got a MODX install by simply viewing your source.

              Some good information about using subfolders and FURL's can be found in this thread: https://forums.modx.com/thread/?thread=73954#dis-post-410673

              Follow the links to the other threads mentioned within for specifics.

                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster