Advertisement
Link takes me to localhost
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Link takes me to localhost
Sorry if this issue is already address somewhere, but I'm not even sure what to look up about this or what to call it. I set a link on my size logo that supposed to take me back to home, and I just set it as "/" I thought this would be relative to the current location, and it appears to be so when I test it on the host machine. However, as soon as I try to click the link on a different machine, it seems to assume that the current position is "localhost" (which it DOES happen to be when run from the server). However, I didn't hard code "localhost" into the link, so I'm not sure why it's trying to base the relative location on that. Does anyone know what the right way is to get the link to just take me back to the home page? Thank you!
Advertisement
- ceford
- Joomla! Virtuoso
- Posts: 3091
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Link takes me to localhost
I don't quite understand how/where you set the link. Could you provide your site url so we can have a look?
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
I set the link inside of the Joomla admin area for my site. I just right clicked the image in the Module editor and added a link, and put "/" as the link. However, I went back later to check it and it had changed it to "../" I changed it back to just "/" Then just now I decided to check "inspect element" on the site, and it showed "localhost" in the link! I went back into the admin panel to check it there, and it's showing with "localhost" in the path there as well! How is it just randomly changing the links that I explicitly set?! This is very weird to me!
- Per Yngve Berg
- Joomla! Master
- Posts: 31667
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Link takes me to localhost
"localhost' is the host name. It will correct itself when transfered to a proper host with a domain name.
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
So why is it not correcting itself? All of the other menu items are transferring properly, so I know my dns is working correctly and that my server is working. But just that one logo link keeps trying to access localhost, which doesn't have anything there on the client machine.
- Webdongle
- Joomla! Master
- Posts: 44993
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Link takes me to localhost
On localhost the root is localhost, which is one folder above the Joomla folder.Blackton wrote: ↑Mon Mar 10, 2025 6:42 pm ... I just set it as "/" I thought this would be relative to the current location, and it appears to be so when I test it on the host machine. However, as soon as I try to click the link on a different machine, it seems to assume that the current position is "localhost" (which it DOES happen to be when run from the server). ...
On localhost you can create an alias. Normally you would type in the browser
localhost/thenameofthejoomlafolder
But if you set an alias then you would just type thenameofthejoomlafolder
That is because of the alias
localhost/thenameofthejoomlafolder would become the root
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
Yes, but why would I want it to go to localhost when there is nothing there? That would only make sense if it was trying to follow that link from on the host machine. Anywhere else that would make it point to the client machine and fail to load anything. Shouldn't the relative path on the client machine just be the domain name for the site that you entered (which would resolve through the DNS to the actual host machine, no the client machine)?
- Webdongle
- Joomla! Master
- Posts: 44993
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Link takes me to localhost
The machine that takes you to
localhost/thenameofthejoomlafolder will have an alias set up.
There is nothing wrong with the way Joomla is working. The problem is there is no alias set up on the machine where it takes you to localhost
localhost/thenameofthejoomlafolder will have an alias set up.
There is nothing wrong with the way Joomla is working. The problem is there is no alias set up on the machine where it takes you to localhost
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
Well all the other links seem to work properly though, just not this one. I did notice that my other links all have "index.php" in them, so I tried adding that to the logo link. In so doing, I undid the "localhost" change that it keeps changing my link address to, and now it seems to work...at least until it changes it back to "localhost" again without asking!
I would like it to not show index.php in every url though. I assume I must have an alias set up already, because I don't see the root site folder in the address bar, but I would like to not see "index.php" either. Is there a place where I can see where any aliases are set so I can change to include the index.php part as well? Thanks for the help!
I would like it to not show index.php in every url though. I assume I must have an alias set up already, because I don't see the root site folder in the address bar, but I would like to not see "index.php" either. Is there a place where I can see where any aliases are set so I can change to include the index.php part as well? Thanks for the help!
- ceford
- Joomla! Virtuoso
- Posts: 3091
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
- Per Yngve Berg
- Joomla! Master
- Posts: 31667
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
OK, I tried following tutorial, but I'm not sure what "virtual host configuration file" refers to, and I also couldn't find "httpd.conf" anywhere on my filesystem, so I'm not sure if my system is allowing .htaccess overriding or not, but I followed all the other steps and it didn't work, so I suppose that could be the problem. Any idea where to look for that "virtual host configuration file, so I can see if that is the problem?" Thanks!
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
I wouldn't mind, but would like to get https working before posting it on a public forum, if that makes any sense. I'm still not sure what the issue is with trying to access the site by https rather than http...
-
- Joomla! Guru
- Posts: 620
- Joined: Fri Dec 02, 2005 10:46 am
- Location: The Netherlands
Re: Link takes me to localhost
Webdongle already explained it a little bit...
You need to take 2 things in consideration:
1 The main root (is there a better word?): holds all the (public facing) website files
I.e. localhost, or example.com
2 Joomla root: the location/folder that holds the Joomla files
I.e. localhost/my-joomla, or example.com/my-joomla
Joomla files can be located in the main root. Then the main root is the Joomla root.
What does a link to "/" do?
It's a link to the main root. So to localhost/ or example.com/
That is how html works.
Why do all other links work correctly?
All links created through Joomla take the Joomla root into consideration and will automatically add it to the link.
If the Joomla root is example.com/my-joomla, then Joomla creates the link /my-joomla/joomla-link
If the Joomla root is example.com, then Joomla creates the link /joomla-link
But why doesn't Joomla add the Joomla root to my "/"?
In html "/" is the main root, the starting point.
Your website/html does not know whether you want to go to the main root (start) or the Joomla root.
How to solve this?
- Create a link to the default menu-item instead of entering "/": Both TinyMCE and JCE have that option
- Or enter the default menu-item link yourself, usually it's index.php?Itemid=101
You need to take 2 things in consideration:
1 The main root (is there a better word?): holds all the (public facing) website files
I.e. localhost, or example.com
2 Joomla root: the location/folder that holds the Joomla files
I.e. localhost/my-joomla, or example.com/my-joomla
Joomla files can be located in the main root. Then the main root is the Joomla root.
What does a link to "/" do?
It's a link to the main root. So to localhost/ or example.com/
That is how html works.
Why do all other links work correctly?
All links created through Joomla take the Joomla root into consideration and will automatically add it to the link.
If the Joomla root is example.com/my-joomla, then Joomla creates the link /my-joomla/joomla-link
If the Joomla root is example.com, then Joomla creates the link /joomla-link
But why doesn't Joomla add the Joomla root to my "/"?
In html "/" is the main root, the starting point.
Your website/html does not know whether you want to go to the main root (start) or the Joomla root.
How to solve this?
- Create a link to the default menu-item instead of entering "/": Both TinyMCE and JCE have that option
- Or enter the default menu-item link yourself, usually it's index.php?Itemid=101
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
Yes, that all makes sense to me, but that's not what Joomla keeps doing. It changes my link from "/" to "localhost." I'm not disagreeing about it interpreting "/" into either "myexample.com" or "localhost," but it's NOT "/", it's "localhost!" I keep changing the link back to "/" but when I check it again, Joomla has always changed it back to "localhost" (which is NOT "/" and therefore will not interpret to "myexample.com" on the client). It wasn't until I changed it to "/index.php" that it stopped changing what I had entered. I guess the other links were working because they were handled by Joomla's article interface, which was automatically adding "index.php" to all of those to make them work.
So the logo link works properly now that it has stopped changing it from "/" to "localhost." But I would like to be able to not have index.php appear in ANY of my URLs, including the URLs that are coming from the articles. I remember when I had worked with Express years ago that it had a route table to interpret all of the URLs however you wanted. Is there some way to do something like that in Joomla, like to get it to interpret "/" as "[main root]/index.php/" instead of just "[main root]"? Thank you!
So the logo link works properly now that it has stopped changing it from "/" to "localhost." But I would like to be able to not have index.php appear in ANY of my URLs, including the URLs that are coming from the articles. I remember when I had worked with Express years ago that it had a route table to interpret all of the URLs however you wanted. Is there some way to do something like that in Joomla, like to get it to interpret "/" as "[main root]/index.php/" instead of just "[main root]"? Thank you!
- Webdongle
- Joomla! Master
- Posts: 44993
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Link takes me to localhost
On your localhost create an 'alias' to the folder Joomla is in then see https://docs.joomla.org/Enabling_Search ... EF%29_URLs
Or just put it on the Host server and follow the instructions on the page linked to.
What localhost are you using?
Or just put it on the Host server and follow the instructions on the page linked to.
What localhost are you using?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
-
- Joomla! Intern
- Posts: 58
- Joined: Mon Feb 17, 2025 4:20 am
Re: Link takes me to localhost
Yes, those were the instructions I was originally trying to follow, but I had mentioned that I don't know what "virtual host configuration file" refers to, and I also couldn't find "httpd.conf" anywhere on my filesystem.Webdongle wrote: ↑Thu Mar 13, 2025 11:15 pm On your localhost create an 'alias' to the folder Joomla is in then see https://docs.joomla.org/Enabling_Search ... EF%29_URLs
Or just put it on the Host server and follow the instructions on the page linked to.
What localhost are you using?
- Webdongle
- Joomla! Master
- Posts: 44993
- Joined: Sat Apr 05, 2008 9:58 pm
Re: Link takes me to localhost
What localhost are you using?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".
- Per Yngve Berg
- Joomla! Master
- Posts: 31667
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Link takes me to localhost
Search for apache.conf
Advertisement