Redirect install in subdirectory to root - how to?

4 replies
Hope my title is descriptive enough.

I have a project management application I've installed in a subdirectory on one of my domains, i.e.

mydomain.com/projectmgt

In retrospect, perhaps I should have installed it in the root. At any rate, what I want to do is have the app appear as if it is installed in the root, so the user navigates to:

mydomain.com

to log in.

Is there a simple way to accomplish this? Please let me know if you need more info.

Thanks!
#install #redirect #root #subdirectory
  • Profile picture of the author SteveJohnson
    This goes in your root-level .htaccess file:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/projectmgt
    RewriteRule (.*) http://yourdomain.com$1 [R,L]
    RewriteRule (.*) /projectmgt$1 [NC,L]
    The above may or may not work - it depends on if URLs or URL paths are hardcoded in your script.

    The easiest solution may be just to reinstall the application in the root folder.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[2914152].message }}
    • Profile picture of the author Darrel Hawes
      Hi Steven,

      You're in my neck of the woods, sorta.

      Thanks for your prompt reply.

      I put your code into my .htaccess file (of course making the correct modifications for my actual domain), and here's what happens:

      You tried to visit mydomain.comprojectmgt, which is not loading
      I don't see what is wrong with the syntax to cause this. Any ideas?
      Signature
      Darrel Hawes - Blog
      {{ DiscussionBoard.errors[2914311].message }}
      • Profile picture of the author KEY
        my personal thinking is that you are concerned over nothing...

        why not just leave the domain free for use as a welcome, sales,
        contact, info, etc page and simply have a link in the footer and in
        the upper right:
        "log in page"

        this way you can tweak the content on the domain's index to your
        hearts content without ever need to mess with the main script's
        index page..?

        KEY (eric)
        {{ DiscussionBoard.errors[2914445].message }}
  • Profile picture of the author caesargus
    why couldn't you just move the files to the root directory? What you could do (if you have this level of access) is to move the files from the project directory and move it to the root, and create a symlink for projectdir and point it to the root directory ("ln -s projectdir . " - I might have the syntax flipped).
    {{ DiscussionBoard.errors[2914960].message }}

Trending Topics