Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Location
    USA
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question Redirect a call for /css/file.css to /dir/css/file.css ?

    I just setup an apache server last night, and I'm liking what I see. I have all of my files contained in /htdocs/ but I have a few websites that I have on my new local server that I've copied from my live server. Inside the /htdocs/ directory, I have three folders, like this example directory structure:
    • htdocs/
      • website1/
      • website2/
      • website3/

    Now, in each of the website folders, paths to included files (such as CSS and Javascript) are written as though the each website is on its own domain. So, for example, each one would call a CSS file in the HTML with this path:
    Code:
    /css/site.css
    However, now that these three websites and their files are under a main root directory, calls such as these are looking for a /css/ directory in the /htdocs/ folder instead of in the specific website/ folder (whether it be website1, 2, or 3).

    What I would like to know is if there is any way to make it so that these calls with leading slashes / will look for the files and directories that are called in the root of the website folder they are inside of, instead of looking for them in the actual /htdocs/ root directory.

    Thanks a lot!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You could make virtual hosts under your xampp, say local1.com, local2.com etc, and then point them to their respective directories.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    TomCat (05-23-2010)

  • #3
    New Coder
    Join Date
    May 2009
    Location
    USA
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I never even knew that was possible. Thanks for that! A few changes to httpd-vhosts.config and the Windows Hosts file and now I have it working just the way I wish.

    By the way, if anyone else has the same question, check out this link: http://www.cortello.com/forum/viewtopic.php?f=9&t=31. It worked for me, and hopefully should work for others, too.
    Last edited by TomCat; 05-12-2010 at 09:53 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •