Jump to content


Photo

PATH_INFO Problem


  • Please log in to reply
4 replies to this topic

#1 Tobster

Tobster
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationAustralia

Posted 11 April 2006 - 11:06 AM

Hello,

I'm trying to implement the PATH_INFO search friendly technique into my website, and I'm pretty comfortable with how to do it. I just started, and ran into a problem: I go to [a href=\"http://localhost/test/index.php/blah\" target=\"_blank\"]http://localhost/test/index.php/blah[/a] and index.php won't include any CSS files, images, or Javascript files. My browser is saying that "CSS file doesn't exist at [a href=\"http://locahost/test/blah/style.css"\" target=\"_blank\"]http://locahost/test/blah/style.css"[/a], when I'm trying to include it as [a href=\"http://localhost/test/style.css\" target=\"_blank\"]http://localhost/test/style.css[/a].

Thanks in advance,
- Toby

#2 bonaparte

bonaparte
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts
  • Location#172, I Floor, 'Hamsashree', Defence Colony, Sahakaranagar, Bangalore, India

Posted 11 April 2006 - 11:41 AM

[!--quoteo(post=363603:date=Apr 11 2006, 06:06 AM:name=Tobster)--][div class=\'quotetop\']QUOTE(Tobster @ Apr 11 2006, 06:06 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hello,

I'm trying to implement the PATH_INFO search friendly technique into my website, and I'm pretty comfortable with how to do it. I just started, and ran into a problem: I go to [a href=\"http://localhost/test/index.php/blah\" target=\"_blank\"]http://localhost/test/index.php/blah[/a] and index.php won't include any CSS files, images, or Javascript files. My browser is saying that "CSS file doesn't exist at [a href=\"http://locahost/test/blah/style.css"\" target=\"_blank\"]http://locahost/test/blah/style.css"[/a], when I'm trying to include it as [a href=\"http://localhost/test/style.css\" target=\"_blank\"]http://localhost/test/style.css[/a].

Thanks in advance,
- Toby
[/quote]


[a href=\"http://localhost/test/index.php/blah\" target=\"_blank\"]http://localhost/test/index.php/blah[/a] - Are you sure index.php is a directory? Perhaps not? Double check the paths.

#3 Tobster

Tobster
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationAustralia

Posted 11 April 2006 - 11:47 AM

index.php isn't a directory, it's my PHP script. There is one way I can do it; put the full URL when including my CSS/image/Javascript files. But I looked at [a href=\"http://freemind.sourceforge.net/wiki/index.php/Main_Page\" target=\"_blank\"]this website[/a], and if you view their source, they just use a relative path -- how do they do it?

#4 bonaparte

bonaparte
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts
  • Location#172, I Floor, 'Hamsashree', Defence Colony, Sahakaranagar, Bangalore, India

Posted 11 April 2006 - 12:03 PM

[!--quoteo(post=363612:date=Apr 11 2006, 06:47 AM:name=Tobster)--][div class=\'quotetop\']QUOTE(Tobster @ Apr 11 2006, 06:47 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
index.php isn't a directory, it's my PHP script. There is one way I can do it; put the full URL when including my CSS/image/Javascript files. But I looked at [a href=\"http://freemind.sourceforge.net/wiki/index.php/Main_Page\" target=\"_blank\"]this website[/a], and if you view their source, they just use a relative path -- how do they do it?
[/quote]


I could ping point the problem if you could be more clearn. Pelase put in the actual paths to make the point clear.

In your first post you say you are including other files in [a href=\"http://localhost/test/index.php/blah\" target=\"_blank\"]http://localhost/test/index.php/blah[/a]. This will not work because index.php is not a directory. There cannot be a subdirectory under test/index.php

You also mention that the browser says that the file [a href=\"http://locahost/test/blah/style.css\" target=\"_blank\"]http://locahost/test/blah/style.css[/a] doesn't exist when you're trying to include it as [a href=\"http://localhost/test/style.css\" target=\"_blank\"]http://localhost/test/style.css[/a]. What the browser is expecting is obviously not there. Note the change in the path - blah/style.css and test/style.css



#5 Tobster

Tobster
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationAustralia

Posted 11 April 2006 - 12:12 PM

Don't worry, I found a way to fix it -- the <base> tag.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users