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 8413367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:54:44+00:00 2026-06-10T00:54:44+00:00

This must be a simple fix, but I just can’t figure it out! I

  • 0

This must be a simple fix, but I just can’t figure it out!

I am including the header via PHP into each new page, the header contains the CSS and scripts etc.

Only problem is since the page is in a different directory, when I link to the header like ../header etc it looks fine but the included scripts, are the included via a short URL e.g. /js/script.js

Which means on the page (in another directory) the scripts do not work!

I’m finding it hard to explain but take a look at this:

http://www.healthygit.com/

If you view the source all the scripts link fine.

Now look at this:

http://www.healthygit.com/fitness/running.php

If you try to click on a script to view it, it takes you to a 404 or in this case 302’s you to the homepage.

  • 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-06-10T00:54:45+00:00Added an answer on June 10, 2026 at 12:54 am

    Easy peasy, your source for the scripts, stylesheets etc. should have a / in front of them, that way the header file will always refer to the files from the root of the site.

    I.e. this:

    src="js/whatever.js"
    

    Should become

    src="/js/whatever.js"
    

    This way it will always look for the files from the root of the site.
    The same applies with CSS files, i.e. /css/whatever.css.

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

Sidebar

Related Questions

This must be simple, but I can't seem to figure it out. I am
This must be quite simple but I can't seem to figure this out. I've
This must be very simple. But I just can't seem to find the proper
This must be quite simple, but I just can't find a way. I have
This must be so simple, but I can't find it: How do you restore
this must be such a simple problem but can someone tell me why this
I must be missing something very simple, but can't find the answer to this.
The problem seems so simple, but I just can't seem to fix it. I
This must be very simple, but I couldn't find it on the documentation. In
There must be a simple solution to this problem but for the love of

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.