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

  • Home
  • SEARCH
  • 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 7500253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:06:54+00:00 2026-05-29T20:06:54+00:00

Possible Duplicate: Absolute path & Relative Path This is a very basic question, but

  • 0

Possible Duplicate:
Absolute path & Relative Path

This is a very basic question, but I have been scratching my head over this for a long time and I am hoping someone can help clear up my confusion.

I have a shared account on a linux server.
The path to public_html is: /home/myusername/public_html
The code for my website lives here: /home/myusername/public_html/mysite.com
Under mysite.com there are directories such as ‘mycss’, ‘myjs’, ‘myphp’, etc.
When I create an absolute path (for example, within php code or an html file), sometimes the path needs to start at /home, eg /home/myusername/public_html/mysite.com/myphp/myfile.php
And sometimes it needs to start inside mysite.com, eg /myphp/myfile.php

My confusion: When does an absolute path need to start at /home, and when does it need to start within mysite.com? Is there a rule of thumb, or some insight anyone can give?

  • 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-29T20:06:55+00:00Added an answer on May 29, 2026 at 8:06 pm

    You are confusing two types of absolute / relateive.

    IF you are speaking in website terms (images / js / html stuff), your absolute is the path from your root website folder (ie: /home/myusername/public_html/mysite.com)

    So if you have a folder like:

    /home/myusername/public_html/mysite.com/images/bob.jpg
    

    In your HTML, the absolute path would be /images/bob.jpg, while a relative website path would be images/bob.jpg etc;

    IF you are doing PHP / Server side includes, you need to use the FULL absolute path, so your whole /home/myusername/public_html/mysite.com stucture.

    But also at the same time, if you want to use a relative method (preferred in most cases as it makes your PHP code easier to move) you would just do an include('../database/connect.php');

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

Sidebar

Related Questions

Possible Duplicate: How to construct a relative path in Java from two absolute paths
Possible Duplicate: Conversion between absolute and relative paths in Delphi I'm trying to figure
Possible Duplicate: Full path from file input using jQuery I have the following html
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: Pre & post increment operator behavior in C, C++, Java, & C#
Possible Duplicate: How to center DIV in DIV? Now i try <html> <head> <title>?????????????????</title>
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: php == vs === operator Reference - What does this symbol mean

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.