Moving Joomla to a subfolder

Discussion in 'Third-party applications' started by John Olson, May 17, 2017.

  1. To get around a known PHP problem I need to move my website from the root to a subfolder. The website is Joomla, and was developed on a Linux-based system. The live site is running from the root at the moment.

    To complicate matters I have a subdomain set up and a URL Rewrite set up to redirect its traffic. The web.config has this rewrite and the 2 standard Joomla rules.

    I have an old test copy of the site in a folder called public_html
    I have made a small change to the site so I can tell if the one I see in my browser is the one in the root or the subfolder.

    What do I need to do to get the Joomla website to run from the subfolder?

    Do I need to create a URL re-write? Do I need to set the public_html folder as an Application Starting Point? Can this be done with DNS?

    I’ve been looking at the forums and found only one similar case, and Winhost’s recommendation was to run the site from the root, which isn’t going to work in this case.

    Cheers

    John
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Yes. You will need to create a URL Rewrite rule unless you want your URL to look like this:

    http://www.mydomain.com/public_html/joomla_files

    You shouldn't need to since it's PHP. The Application Starting Point only affects ASP.NET files, so unless you will have ASP.NET files in the root, it shouldn't be necessary.

    No, I'm afraid not.
     
  3. Where do I find information about writing the rule? I've written one that rewrites the URL for a subdomain, but haven't managed to write something that redirects all traffic properly to a subfolder. There are also 2 Joomla created rules, and I can't find any reference about whether these should be in the root web.config or the subfolder web.config

    I tried opening a ticket, but getting Joomla to run properly on your servers is considered "individual website programming" and not supported.
     
  4. Near the end of this Knowledge Base article there is a "Accomplishing the Redirect" section with a few links to rewrite code.

    You'll want to put the rewrite in the root web.config (anything in the root is also applied to subdirectories, so you should be able to put the Joomla rules there as well).
     
    Elshadriel likes this.
  5. Elshadriel

    Elshadriel Winhost Staff

Share This Page