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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:05:24+00:00 2026-06-09T11:05:24+00:00

I was wondering how I could access domain.com/home from domain.com , I have asked

  • 0

I was wondering how I could access domain.com/home from domain.com, I have asked this question before (One web page with multiple URL's using PHP) and i was told to use chdir() and include() but now I was wondering how I could this so that it would work with local .css files, as currently if I access “domain.com/home” when the head says “using style.css” it accesses domain.com/home/style.css as it should but however if i access domain.com it accesses domain.com/style.css as it is asking for a local file, changing all of the local file accesses is impractical as they are all drawing from a template using php includes so modifying one of them is inconvenient to do and not aesthetically pleasing in terms of code cleanliness.

If you do not fully understand what I am asking go to
http://infinity-nova.com and http://infinity-nova.com/home too see the issue at hand. Is there any way to do this using htaccess? I am using an apachi server so i am able to use any url-rewriting plugins and what not that apachi has if that is necessary.

  • 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-09T11:05:26+00:00Added an answer on June 9, 2026 at 11:05 am

    Your treating two different problems as the same thing. The location of your internal PHP scripts is one issue, looks like this has been resolved.

    The browser being able to locate resources is a totally different matter, depending on how your application is setup.

    If your application needs to be completely portable (loaded into any directory) then you need to create a baseUrl() function to use throughout your application.

    Lets say you load you app into something.com/foo/bar/myapp where myapp is the root of your application. In your bootstrap (this is a script that runs before anything else, often to setup things like database connections) you must hardcore or otherwise determine the base URL your application is running in, an example:

    $baseUrl = "/foo/bar/myapp";
    

    Throughout the rest of your application you need to use this variable (if your application is object orientated a static function is also appropriate) like this:

    <?php
    <html>
      <head>
        <script src="<?= $baseUrl ?>/js/myscript.js"/>
        ...
    

    MVC frameworks handle parsing this base URL differently and some come with a function to do it automatically, but the basic process is the same. When your page is rendered it will look like:

    <html>
      <head>
        <script src="/foo/bar/myapp/js/myscript.js"/>
        ...
    

    If you move your app you will also have to redefine the $baseUrl variable but all your paths will change accordingly.

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

Sidebar

Related Questions

I was wondering how could I remove one (wrongly inserted) entry/word from the ispell
I seperate my domain logic from my web service logic This is from my
I was wondering how I could access the iPhone's Home Screen Image so that
I was wondering how I could access data from another class using Xcode 4.2
I'm wondering what could cause this. I have several methods in my code that
This question received great answers in jquery and I was wondering if someone could
i am wondering could i access my app internal storage using emulator. I mean
I've added an object to the XsltArgumentList. I was wondering how I could access
I had accidentally tried this, which compiles! So I was wondering what could this
I'm pretty new to dojo and was wondering how I could have an iframe

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.