We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41444
    • 6 Posts
    Quite new to MODX revolution.

    I have installed MODX in the file "press" of my website. I have thus: www.mydomain.com/press/.

    I would like that the url for the index page to be: http://www.mydomain.com/index.html. Is this possible? (For the moment I have http://www.mydomain.com/press/index.htm)

    Preferably, I would also like to have an index.php page rather than an index.html one. What are the changes to be made to obtain this?

    Thanks a lot in advance for your answer.
    • In your .htaccess file make sure to edit the RewriteBase from / to /press.

      Why do you want it to be .php instead of .html? Keep in mind that all of your site's pages are actually "index.php?id=xx" where xx is the resource ID. It's the htaccess rewrite rules that allow the use of an alias to make a "friendly" url.

      This can be changed in System->Content Types.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 41444
        • 6 Posts
        Thank you Susan!

        I have already "RewriteBase /press" in my .htaccess file, but my problem is that I want the index.html page not to be in "press". The others files can be in "press.

        If I understand well, you suggest it is better to keep html.
        • Well, it depends on how the "press" domain is handled in the server's virtual hosts. Is it mydomain.com, or is it just installed in a subdirectory of mydomain.com's web root? Is it a subdomain (press.mydomain.com)?

          For example, in my localhost development environment, I have several installations in subdirectories, such as revo224, revo23, evo106. Each one of these has the .htaccess file's RewriteBase line edited to reflect its location, so they are accessed as localhost/revo224/blah.html and so forth. However, in my remote Bluehost installation, I have several test installations configured as subdomains, such as dev.sottwell.com and these do NOT have the RewriteBase line modifed.

          A subdomain such as press.mydomain.com can also be accessed via mydomain.com/press, as long as that is its actual file location.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 41444
            • 6 Posts
            Thank you again. No, "press" is not a subdomain. "press" is a folder containing MODX. I did not want to have MODX in my URL's so I renamed the folder in "press".
            • Then there isn't anything you can do about it. If it's a subfolder, that's the way it has to be. How else would the server know to use that index.whatever, and not the one in the web root? If there isn't an index.html in the web root, you could use a rewrite rule in the .htaccess file to rewrite all plain index.html requests to /press/index.html, but then you would still have the problem of MODx generating the URL for it.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 41444
                • 6 Posts
                Once again, thanks!

                According to your comment, I'll have most probably to move MODX from the subfolder and put it in the web root. I don't like so much the idea because of the clarity in the site structure, but if there is no other way.
                • Unless you have access to the web server configuration and can point a virtual host entry for the domain to the file location of the installation, or can add a domain to your shared hosting account (which does the same thing automatically), moving the installation is the only thing you can do.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org