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.
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/myappwheremyappis 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: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:
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:
If you move your app you will also have to redefine the $baseUrl variable but all your paths will change accordingly.