/    Sign up×
Community /Pin to ProfileBookmark

I am making and testing a site on my computer. i have php, mysql and apache all set up.

i have the site now. but i am using the site root paths.

like /news/new/index.php instead of linking like ../news/new/index.php.

so when i upload it to my server i don’t have to change anything. but when i try to view my page it looks for my files in the root. [url]http://localhost/file[/url] but becuase i have them in a folder it can not find them.

so it is looking for [url]http://localhost/file[/url]

but the file is at [url]http://localhost/folder/file.[/url]

so in apache how do i set that folder as the root. if that is possible?

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@buntineMar 14.2004 — I havent used apache for ages...

You have to edit the config file. You will be familiar with it as you need to alter it when setting Apache up, though, i cant even remember its name..

One of the Apache users will be able to help you out more..

Regards.
Copy linkTweet thisAlerts:
@CyCoMar 14.2004 — ...you'll need to make the changes in the httpd.conf file

DocumentRoot can be modified there...

changes will take effect after restarting the server...
Copy linkTweet thisAlerts:
@chris9902authorMar 14.2004 — ty.

how do i make it displat my index.php page
Copy linkTweet thisAlerts:
@CyCoMar 14.2004 — ...I believe that in the httpd.conf file, there are provisions for adding the index extensions you want the server to look for in the DirectoryIndex section...just add index.php there
Copy linkTweet thisAlerts:
@buntineMar 15.2004 — 
httpd.conf
[/quote]

Thats it?
×

Success!

Help @chris9902 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...