Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3225596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:21:28+00:00 2026-05-17T16:21:28+00:00

I have a Virtual Private server with Dreamhost. I’m trying to create a shared

  • 0

I have a Virtual Private server with Dreamhost. I’m trying to create a shared folder that all of my domains can access. In the folder I’d like to put PHP classes, and even static files like javascripts.

I’ve created a directory on the same level as my domain folders. I’d like to call a file via something like this… /home/username/shared/file.php. This isn’t working however, and I’m hoping some magic (like .htaccess maybe) will make this work.

EDIT: Oops, OK, I am able to include PHP files using the method above. How can I include static files like Javascript, CSS, images, etc from the same directory?

This works:

<?php include('/home/username/shared/file.php'); ?>

This doesn’t work:

<link rel="stylesheet" type="text/css" href="/home/username/shared/reset.css" media="screen" />

Alternatively, I realize that I could just place my static files inside of a domain, and simply point to them, but I’d like to know how to make this other configuration work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:21:28+00:00Added an answer on May 17, 2026 at 4:21 pm

    You should be happy that <link rel="stylesheet" type="text/css" href="/home/username/shared/reset.css" media="screen" /> did not work. If it would, you would have a great security hole.

    The correct way is to make a symlibk to that shared directory in your document root, or using Aliases.

    The Symlink Method

    Run the following in a shell:

    ln -s /home/username/shared /home/target/
    

    It’ll create a symlink named /home/target/shared, pointing to /home/username/shared. You might need add a Options +FollowSymLinks directive to your server config (or a .htaccess file)

    The Alias Method

    This method requires a change in your server configuration (e.g. httpd.conf). Add an Alias directive to it:

    Alias /shared /home/username/target
    

    Note: this will only be used for requests through your server (e.g. http://example/shared/reset.css), and not for PHP files. Within PHP files, you have to use the full path (/home/username/shared/file.php)


    Which method you choose is up to you. The latter is easier to configure as you do not have to worry about permissions / ownership. The former could be used if you really need to use /home/target/shared/file.php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Virtual PC 2007. I am writing a C# program that will run
I have a virtual path (example: ~/Images/Banner.jpg) and I want to make that an
Here's my problem: I have a virtual method defined in a .h file that
On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts
I have a VmWare virtual machine that is coming dangerously close to it's primarry
I have a Virtual Machine in Virtual PC 2007. To start it from the
I have a virtual machine (VMware) with Mercury Quick Test Professional 9.2 installed. I
I have a virtual host setup on Apache 2 like so (simplified): <VirtualHost *>
Is it possible to have two virtual directories under the same website in IIS
What is the best way to have a virtual operating system have a static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.