Links problem

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Links problem

Postby vicram » 14. May 2009 09:08

Hi all,
I installed xammp. I create a subdirectory in htdocs : /test/ and create /test/index.php
Now from browser in localhost/test/ i see the page.
In my page I have a link in htdocs/test/page.php like this <a href="/page.php">go</a> but it go to localhost/page.php and not in localhost/test/page.php...WHY????

Can you halp me?? I want that the link "/" is the default path for htdocs/test/

thanks
vicram
 
Posts: 4
Joined: 14. May 2009 09:03

Re: Links problem

Postby Wiedmann » 14. May 2009 09:19

In my page I have a link in htdocs/test/page.php like this <a href="/page.php">go</a> but it go to localhost/page.php and not in localhost/test/page.php...WHY????

Your DocumentRoot is "htdocs". And that's the starting point "/" in an URI-path.

I want that the link "/" is the default path for htdocs/test/

Well, you can change you DocumentRoot to "htdocs/test". But I guess it's easier to put your files in "htdocs" instead in "htdocs/test".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Links problem

Postby vicram » 14. May 2009 10:33

Where I change documentroot?
In index.php I have stylesheet="/style.css" and serverweb load htdocs/style.css and not htdocs/test/style.css
It's not a php problem, but a xampp configuration problem...
vicram
 
Posts: 4
Joined: 14. May 2009 09:03

Re: Links problem

Postby Wiedmann » 14. May 2009 10:53

Why want you put your files in "htdocs/test"?
--> just putting them in "htdocs" and you have no problems.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Links problem

Postby vicram » 14. May 2009 13:14

Wiedmann wrote:Why want you put your files in "htdocs/test"?
--> just putting them in "htdocs" and you have no problems.


Because my file index.php in localhost is redirect always in http://localhost/xampp/index.php :cry:
vicram
 
Posts: 4
Joined: 14. May 2009 09:03

Re: Links problem

Postby Wiedmann » 14. May 2009 14:11

Because my file index.php

Sure it's your "index.php". Or is it that one which comes with XAMPP?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Links problem

Postby vicram » 14. May 2009 15:05

Wiedmann wrote:
Because my file index.php

Sure it's your "index.php". Or is it that one which comes with XAMPP?


It's mine!

<?
phpinfo();
?>
vicram
 
Posts: 4
Joined: 14. May 2009 09:03

Re: Links problem

Postby Wiedmann » 14. May 2009 15:14

Clear your browser cache.
(and maybe delete an existing "index.html", which is not from you)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests