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

    For exemple, this is my tree

    • Directory (ressource id 1)
      [list]
      [li]Welcome (2)
    • Other-page (3)
    [/li]
    [/list]
    The alias for ressource 2 is:
    /directory/welcome.html

    And my site_start is 2.

    How to use the full url of ressource 2 when we call this page, because I want to stay site_start to 2 and keep the full path, but at this time, when I reach this ressource, the full url change to ’/’.

    Low.
      Low
      • 22629
      • 194 Posts
      Sorry I think what you’re asking is a little vague.

      Are you saying that if you browse to, for example, www.mysite.com, you would like people to be redirected to www.mysite.com/directory/welcome.html?

      Or are you saying that if you browse to www.mysite.com/directory/welcome.html, you’re being redirected to www.mysite.com?

      Or are you saying that if you put [[~2]] in a document, it’s generating "/" as the URL instead of "/directory/welcome.html"?
        Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

        modx Revolution 2.2.6
        Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

        Content-Managed Websites Built on MODX
        • 17546
        • 75 Posts
        My site is http://www.example.com
        site_start is #2 (full url /directory/welcome.html)
        When I enter to my site at http://www.example.com, I would like to redirect to the full url as:
        http://www.example.com/directory/welcome.html
        But, because this ressource id 2 is the site_start value, modx redirect my request http://www.example.com/directory/welcome.html to the root http://www.example.com/

        always vague ?
          Low
          • 22629
          • 194 Posts
          OK that makes it clearer, thanks.

          For your first request, I’m guessing (someone else may be able to correct me here) that you’ll need to redirect requests for / to /directory/welcome.html at the Apache level.

          I can’t say I’ve noticed your second issue - I’ll give it a try on my install when I get home later this evening.
            Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

            modx Revolution 2.2.6
            Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

            Content-Managed Websites Built on MODX
            • 17546
            • 75 Posts
            I don’t want to do a redirection in the apache level under the .htaccess file, because if my customer change the alias I must update the .htaccess file.

            My solution is:

            WEB (context)
            directory (1)
            welcome (2)
            about (3)

            site_start = 1
            using the FirstChildRedirect in the #1 ressource, and it work !! but, I don’t like this method.

            Simple question:
            Why a ressource (alias) named /mypage.html is remplaced by the ’/’ if this ressource is the site_start value !!

            Low
              Low
              • 22303 MODX Staff
              • 10,725 Posts
              Don’t make that page your site_start then; you can make a simple hidden WebLink Resource your site_start that points at Resource 2. It will then redirect users to the resource with id 2 when someone goes to /.

              Disclaimer: This may or may not be good for SEO AFAIK, but I am still telling you how to accomplish this anyway. wink
                • 17546
                • 75 Posts
                Well, I use context for multiple domains, and for each context, I use a site_start (maybe a bad solution).
                At the root, just one ’content’ ressource as site_start and the FirstChildRedirect snippet, well, it work.
                If my site_start is, and for all my site/context define as 1, an error occur when I reach the root level of each domain.

                I would like to disabled the redirection to the ’/’ when I call the url of the site_start ressource, impossible ?
                  Low