We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36755
    • 41 Posts
    Hi dear modx-community,

    I ran into an issue by moving my modx from /cms/ to / (root).

    Friendly URLs are set up to e.g. mydomain.com/releases ... however, such a directory exists already on the root! Thus, the directory is loaded instead the virtual link of modx!

    There is no index.html/index.php in the directory, only other files. So I get a 404 Forbidden instead of modx loading the content.

    Does anybody know how to resolve this without renaming the directory? Is there an htaccess-way to do that?

    Thanks in advance!
    Kai



    PS: I found this sad
    Remember the Filesystem Always Takes Precedence

    The filesystem on your server will always take precedence over the rewritten URL. For example, if you have a directory named “services” and within that directory is a file called “design.html”, you can’t have the URL redirect to “http://domain.com/services”. What happens is that Apache goes into the “services” directory and doesn’t see the rewrite instructions.

    To fix this, simply rename your directory (adding an underscore to the beginning or end is a simple way to do that).
    source


    Update:
    Maybe there is a way to handle the 404-Error to "leave" the directory and call modx (and htaccess) from root to do the friendly url?! [ed. note: kajus99 last edited this post 14 years, 8 months ago.]
      • 32316
      • 387 Posts
      Why don't you want to rename the directory?
        • 36755
        • 41 Posts
        @whistlemaker: Because I have a lot of scripts that point to those folders (it's not only one like in the example).

        But I guess this is what I have to do... renaming all directories.
          • 32316
          • 387 Posts
          thought it might be something like that

          I would imagine you could do something with .htaccess but I think it would have to be fairly specific and could easily cause future maintenance issues far more complicated than some renaming now!
            • 36755
            • 41 Posts
            @whistlemaker: Thanks for your reply. Yep, with notepad++ it becomes easy to batch-rename all paths in php scripts smiley luckily.