homepage Welcome to WebmasterWorld Guest from 54.211.213.10
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
File Path Problem on New Server
support tell me to use ./ instead of /
old_expat




msg:3411178
 5:12 am on Aug 2, 2007 (gmt 0)

I'm trying to get set up on a new dedicated server. I copied over all my accounts and immediately saw this problem.

All my includes, .css and image files are coded as;

/*.css
/*.jpg
etc

I changed one test page to *.jpg and it worked, but I really don't want to change and upload over 3,000 pages.

Support told me to changing them to ./*.jpg

That works too, but same problem.

Is this an Apache config problem?

 

theBear




msg:3411367
 12:10 pm on Aug 2, 2007 (gmt 0)

Are you saying that things like:


<img src="/readrin2.gif" alt="readers web ring image" border=0 width=116 height=79 vspace=3></a>

are not working?

Does your regular navigation work?

Is it of the same form?

The above form in this case requires that the file readerin2.gif be in the document root.

Can you show us the configuration file things might be a little off.

DocumentRoot /home/accountname/someplace/yetanotherplace/
<Directory />
Options -Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
</Directory>

Name changed to protect the guilty etc ....

Works correctly using your /aaaaa.jpg form.

[edited by: theBear at 12:12 pm (utc) on Aug. 2, 2007]

jdMorgan




msg:3411527
 3:13 pm on Aug 2, 2007 (gmt 0)

Stop! Run! Get away!

Tell them to fix this immediately, or you're leaving. If they can't get DocumentRoot right, you are going to have nothing but trouble with them...

If your page is at the Web root (i.e. in the "home page" directory), and it references any of these, they should all resolve to the same file:

<img src="logo.gif">
<img src="/logo.gif">
<img src="http://example.com/logo.gif">

That is a fundamental requirement, unless you want to be forever tweaking every page and every script you put onto this server... And if you don't have the source code for a script and can't modify it, you won't be able to use it at all.

Jim

old_expat




msg:3411544
 3:25 pm on Aug 2, 2007 (gmt 0)

I was not able to answer some of these questions because I had such a lousy internet connection I couldn't ftp into /home or /(root).

I'm trying to look at the sites using IP addresses

I couldn't test the navigation very well because I haven't changed the nameservers at the domain host. And since I use absolute links, they point to my live sites on the existing server.

They believe it is a DNS issue.

theBear




msg:3411549
 3:29 pm on Aug 2, 2007 (gmt 0)

Jim,

I don't know where he got his server from but it wouldn't be the first place to have brand spanking new servers with brand new up to date software that is out to lunch on its defaults. Let alone the hosting providers staff being out to lunch or is that just plain out of it?

It does make one wonder though doesn't it.

jdMorgan




msg:3411718
 5:20 pm on Aug 2, 2007 (gmt 0)

theBear,

It's probably just some kludge they've got for IP-based access before the real hostname goes live. That pretty much takes away the appeal of being able to work on the site using its IP address or some back-door URL like "hostname.com/user/"

I sure wouldn't want to have to change something as basic as on-page links just to be able to test on a new server before going live!

Jim

theBear




msg:3412051
 10:30 pm on Aug 2, 2007 (gmt 0)

Jim,

It could be so many things I wouldn't even want to list them.

There are probably as many fouled up web hosting providers as there are grains of sand on the beaches. But to be fair (Why I would want to be fair I don't know.) I have seen plenty of messed up default templates provided by the software folks, the dns server folks, and so on down the line (Anyone want to discuss forum software and shopping carts systems? I thought not.)

I'm sure the the old one knows exactly how to wield his ordinance.

[edited by: theBear at 10:31 pm (utc) on Aug. 2, 2007]

old_expat




msg:3426586
 7:27 am on Aug 20, 2007 (gmt 0)

Well, the hosts told me they had fixed this (the original) problem, and it had *appeared* that they did .. until today .. maybe ..

I added a series of pages to a site. The site is set up in directories to separate content, other files and includes

/
/inc/head.php
/inc/foot.php
/inc/menu.php

/other-files/*.jpg
/other-files/*.css

/directory1/page1.php
/directory1/page2.php
/directory1/page3.php

I added the series of pages, and put a link structure at the bottom of the content to page i.e

¦page1¦page2¦page3¦

I noticed that images were not showing on page 2. Neither were styles working. But head.php, foot.php, menu.php were being included.

I finally tracked the problem to a cut-and-paste issue. One of my links was:
href="http://www.mysite.com/directory1//page2.php"

(note the '//' in filepath)

Okay, I can understand that I might get a 404, but why will I get the /inc/ working but not the /other-files/

So was the original problem fixed, or just masked?

Am I being overly paranoid?

jdMorgan




msg:3426803
 1:29 pm on Aug 20, 2007 (gmt 0)

It could be any number of things...

On Apache, the URL-path
/directory1//page2.php
is identical to
/directory1//page2.php

So normally, things should work even with double-slashes all about.

However, things like anti-hotlinking code, scripts that check requested URLs and are picky about it, or a host's mod_rewrite applied to your directory could conceivably break when double-slashes appear in the URL-path.

The only way to tell is to test several of your broken-CSS-and-image cases, and examine your server error log to see what error the server reported in each case. That will single out the problem or narrow it down considerably.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved