684425 Posted December 22, 2014 Share Posted December 22, 2014 I am using xampp. <a href="/">Home Page</a> The above code (when clicked in browser) takes me to the localhost instead of localhost/website How can i clear this issue? Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/ Share on other sites More sharing options...
LeJack Posted December 22, 2014 Share Posted December 22, 2014 This is an HTML problem. Use /website instead of / for your link. Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/#findComment-1500317 Share on other sites More sharing options...
684425 Posted December 22, 2014 Author Share Posted December 22, 2014 The same thing in a site <ul class="col-sm-2 col-sm-offset-2"> <li><a href="/">Home</a></li> <li><a href="https://secure.payza.com/login">Log In</a></li> <li><a href="https://secure.payza.com/signup">Sign Up</a></li> </ul> The site is online. Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/#findComment-1500318 Share on other sites More sharing options...
LeJack Posted December 22, 2014 Share Posted December 22, 2014 The same thing in a site <ul class="col-sm-2 col-sm-offset-2"> <li><a href="/">Home</a></li> <li><a href="https://secure.payza.com/login">Log In</a></li> <li><a href="https://secure.payza.com/signup">Sign Up</a></li> </ul> The site is online. The reason why you are seeing the home page of localhost is because you're using "/" which represents the base folder or URL. If you have this file saved in a sub folder and you're trying to do something like localhost/website, you need to add the website name after the / because HTTP will assume that you are looking for the main page of the URL which is localhost. Again, this is not a PHP problem. This is an HTML problem. 1 Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/#findComment-1500320 Share on other sites More sharing options...
684425 Posted December 22, 2014 Author Share Posted December 22, 2014 Again, this is not a PHP problem. This is an HTML problem. I am sorry i have posted it by mistake in php section. How can i correct it? Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/#findComment-1500325 Share on other sites More sharing options...
LeJack Posted December 22, 2014 Share Posted December 22, 2014 I am sorry i have posted it by mistake in php section. How can i correct it? Moderators will move this topic accordingly. No need to make multiple topics relating to the same problem. Quote Link to comment https://forums.phpfreaks.com/topic/293221-hyperlink-not-working-as-it-should-be/#findComment-1500327 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.