Redirect install in subdirectory to root - how to?

by 4 replies
5
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!
#programming #install #redirect #root #subdirectory
  • 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.
    • [1] reply
    • 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:

      I don't see what is wrong with the syntax to cause this. Any ideas?
      • [1] reply
  • 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).

Next Topics on Trending Feed