Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 2nd, 2012, 06:02 PM
CallMeAndy CallMeAndy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 29 CallMeAndy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 10 sec
Reputation Power: 0
general - Alias issue and 404

Hi guys can anybody direct me.

Platform is Windows XP sp3 - local dev environment with Apache 2.2.19

have this in my httpd.conf

Alias /NamadanImages "C:\Documents and Settings\Andrew Seabrook\My Documents\TheAuthor\Namadan\images"
<Directory "C:\Documents and Settings\Andrew Seabrook\My Documents\TheAuthor\Namadan\images">
Order allow,deny
Allow from all
</Directory>

Have this in the browser address bar
http://localhost/phpgal/NamadanImages/craymark/eagle.jpg

getting 404 error !!!!!!

the following file exists in file system! displaying if I type it into the browser address bar thus: file:///C:\Documents and Settings\Andrew Seabrook\My Documents\TheAuthor\Namadan\images\craymark\eagle.jpg

Reply With Quote
  #2  
Old June 2nd, 2012, 06:08 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,707 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 6 h 38 m 16 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
/NamadanImages is not the same as /phpgal/NamadanImages.

Reply With Quote
  #3  
Old June 2nd, 2012, 06:34 PM
CallMeAndy CallMeAndy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 29 CallMeAndy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
/NamadanImages is not the same as /phpgal/NamadanImages.


No its not, correct, but the webpage is being served from localhost/phpgal

please spell out why this is a problem - how do I alias a filesystem directory from webpage located deeper than localhost?

Reply With Quote
  #4  
Old June 2nd, 2012, 07:44 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,707 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 6 h 38 m 16 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Quote:
Originally Posted by CallMeAndy
No its not, correct, but the webpage is being served from localhost/phpgal

Alias only cares about the URL. Page, site, document root, none of those matter.

Did you try just changing the alias to use "/phpgal/NamadanImages"?

Reply With Quote
  #5  
Old June 3rd, 2012, 03:36 AM
CallMeAndy CallMeAndy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 29 CallMeAndy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
Alias only cares about the URL. Page, site, document root, none of those matter.

Did you try just changing the alias to use "/phpgal/NamadanImages"?


Well yes and thanks it works - but really cant get my head around the substitution made by apache on this.

The actual page index.php that is found at localhost/phpgal is made up of images constructed along these lines:

<a href="./NamadanImages/craymark/800px-DanubedeltaSulinaarm2.jpg" class="photo-link smoothbox" rel="gallery"><img src="./NamadanImages/craymark_thumbs/800px-DanubedeltaSulinaarm2.jpg" /></a>

surely when resolved the aliases would be formed: ./phpgal/filespec/..../image.jpg

ordinarily however if i included the phpgal part of the url it would not find the image.
To ilustrate what I mean i just bunged a couple of images in the site root: localhost/phpgal

I am requesting localhost/phpgal/index.php in the browser address bar

and hard coded this at the top of the page;

<a href="./phpgal/danube.jpg" class="photo-link smoothbox" rel="gallery"><img src="./phpgal/danube_copy.gif" /></a>

not surprisingly it cant find that image

yet these below it with the altered alias as per your suggestion are working
<a href="./NamadanImages/craymark/800px-DanubedeltaSulinaarm2.jpg" class="photo-link smoothbox" rel="gallery"><img src="./NamadanImages/craymark_thumbs/800px-DanubedeltaSulinaarm2.jpg" /></a>

What is it I am not understanding about the substitution?

Reply With Quote
  #6  
Old June 3rd, 2012, 03:59 AM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,707 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 6 h 38 m 16 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
What I can't get my head around is what you're confused about. Your post doesn't make any sense to me So let me throw out some information and I'll hope it helps.

If you're in /phpgal/index.php and you put some links to "./phpgal/danube.jpg" then the browser will resolve it to "/phpgal/phpgal/danube.jpg" (note the repetition) and ship that off to Apache. Apache doesn't know anything special about that URL so it will try to serve it normally; since there is no such file there it will reply with a 404.
If your document root was (a conveniently short) C:\www then Apache will look for C:\www\phpgal\phpgal\danube.jpg.

If you instead link to "./NamadanImages/craymark" (the directory) then the browser will ask for "/phpgal/NamadanImages/craymark". This time Apache recognizes the "/phpgal/NamadanImages" prefix from the Alias you used, so instead of looking in the document root like it normally would it looks in whatever the Alias you gave had.
Even though the document root is C:\www the Alias says to start looking in C:\etc\Namadan\images, thus the final file path is C:\etc\Namadan\images\craymark.

Reply With Quote
  #7  
Old June 3rd, 2012, 05:14 AM
CallMeAndy CallMeAndy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 29 CallMeAndy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
What I can't get my head around is what you're confused about. Your post doesn't make any sense to me So let me throw out some information and I'll hope it helps.

If you're in /phpgal/index.php and you put some links to "./phpgal/danube.jpg" then the browser will resolve it to "/phpgal/phpgal/danube.jpg" (note the repetition) and ship that off to Apache. Apache doesn't know anything special about that URL so it will try to serve it normally; since there is no such file there it will reply with a 404.
If your document root was (a conveniently short) C:\www then Apache will look for C:\www\phpgal\phpgal\danube.jpg.

If you instead link to "./NamadanImages/craymark" (the directory) then the browser will ask for "/phpgal/NamadanImages/craymark". This time Apache recognizes the "/phpgal/NamadanImages" prefix from the Alias you used, so instead of looking in the document root like it normally would it looks in whatever the Alias you gave had.
Even though the document root is C:\www the Alias says to start looking in C:\etc\Namadan\images, thus the final file path is C:\etc\Namadan\images\craymark.


If I knew why I was confused confused then I wouldnt be confused anymore.

My failure to understand though comes from the fact that I expected apache only to substitute the string: "/NamadanImages"

so that the link "NamadanImages/craymark/danube.jpg" effectivly becomes a filespec.
echo '<a href="C:/Documents and Settings/Andrew Seabrook/My Documents/MyWeb/phpgal/danube.jpg" class="photo-link smoothbox" rel="gallery"><img src="C:/Documents and Settings/Andrew Seabrook/My Documents/MyWeb/phpgal/danube_copy.gif" /></a>';

which I see from later experiment is not recognised.


And also as this string "/phpgal/NamadanImages" is not in the link I would not have expected it to attempt to substitute anything.

I guess we are not talking about littoral string substitution, but rather a deterministic substitution (resolving), based on apaches UNDERSTANDING of URLs which is knowledge I dont have and perhaps why I made other assumptions about the substitution.

If I still havnt got it please feel free to try and help me further, either way much appreciate your help.

Andy

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > general - Alias issue and 404

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap