CrazyEngineers
  • Hi,
    Is there any way to redirect localhost to always redirect to 127.0.0.1 when i type localhost ??

    OS: Windows 8 32bit
    Test Server: WAMP
    Purpose: Testing Magento. and Admin login is not working on localhost. but working on 127.0.0.1.
    but the problem is 127.0.0.1 keep redirecting to localhost! 👀

    TIA. 😀
    Big_B
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    localhost = 127.0.0.1 . I'm not sure where your browser is taking you. You may try editing hosts file : <a href="https://www.crazyengineers.com/threads/editing-c-windows-system32-drivers-etc-hosts-file-on-windows-vista.1749">Editing C:\Windows\System32\drivers\etc\hosts file on Windows Vista</a> and add entry-

    127.0.0.1 localhost
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberNov 16, 2013

    Big_B
    Hi,
    Is there any way to redirect localhost to always redirect to 127.0.0.1 when i type localhost ??

    OS: Windows 8 32bit
    Test Server: WAMP
    Purpose: Testing Magento. and Admin login is not working on localhost. but working on 127.0.0.1.
    but the problem is 127.0.0.1 keep redirecting to localhost! 👀

    TIA. 😀
    Big_B
    That's strange, which browser are you working on?
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Kaustubh Katdare
    localhost = 127.0.0.1 . I'm not sure where your browser is taking you to. You may try editing hosts file : <a href="https://www.crazyengineers.com/threads/editing-c-windows-system32-drivers-etc-hosts-file-on-windows-vista.1749">Editing C:\Windows\System32\drivers\etc\hosts file on Windows Vista</a> and add entry-

    127.0.0.1 localhost
    I have the same code as you suggest in host file!

    127.0.0.1      localhost
    I face this problem only when i try to login to admin panel of Magento.
    otherwise everything works fine. 😀

    I have search on the Google on this problem and find a solution to update core file that solve the problem but #-Link-Snipped-# also said that,

    We do not recommend this solution for a production version of Magento, but for you local test environment this will work.
    is there any proper solution for this?
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Manish Goyal
    That's strange, which browser are you working on?
    I am Using Chrome 30.0.1599.101
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberNov 16, 2013

    I don't remember exactly what I did for Magento last time when I had worked 2 years ago

    Just add one more entry to hosts file 127.0.0.1 xyz.com

    Then restart xampp or wamp and open xyz.com/magento, I don't which config file to edit, you can simply re-install magento
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    @#-Link-Snipped-# - You could quickly post the contents of your hosts file?
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Kaustubh Katdare
    @#-Link-Snipped-# - You could quickly post the contents of your hosts file?
    Here is the content of host file:

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97    rhino.acme.com          # source server
    #      38.25.63.10    x.acme.com              # x client host
    
    # localhost name resolution is handled within DNS itself.
    #    127.0.0.1      localhost
    #    ::1            localhost
    
    127.0.0.1      localhost
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    The hosts file looks okay. Since you're in Windows 8 environment, it will try to figure out the IPv6 addresses first before IPv4. Could you try totally removing

    # ::1 localhost

    from the file and then restarting your apache server? If that doesn't work, we'll have to make edits to the apache configuration (I think).
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    Update: If that doesn't work for you,

    edit httpd.conf file and change -

    Listen 80
    TO
    Listen 0.0.0.0:80
    Restart Apache and let us know if everything works fine for you. What this option does is ignore all the IPv6 range. Do restore it once you're done with your work on WAMP and you really want IPv6 powers 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Manish Goyal
    I don't remember exactly what I did for Magento last time when I had worked 2 years ago

    Just add one more entry to hosts file 127.0.0.1 xyz.com

    Then restart xampp or wamp and open xyz.com/magento, I don't which config file to edit, you can simply re-install magento
    I am running it on local so 127.0.0.1 xyz.com wont work, as it will be point to some actual domain xyz.com in this case.

    Re-installing will lost my all work. so finding the solution.
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberNov 16, 2013

    can you give me remote control of your system via team viewer?

    PM me your TV ID
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Nothing working guys....
    Anyways re-install it Finally, all the things back to normal.
    Might be some problem with previous installation or else..

    Thank you guys for the quick support. 😀
    Tag: #-Link-Snipped-# , #-Link-Snipped-#

    --
    Big_B
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    @#-Link-Snipped-# - Did you try editing the httpd.config file to reflect the settings I mentioned above? That should work. Give it a try before you decide on starting from scratch.

    PS: If you have reinstalled everything by now, please let us know whether that solved the problem.
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    Kaustubh Katdare
    @#-Link-Snipped-# - Did you try editing the httpd.config file to reflect the settings I mentioned above? That should work. Give it a try before you decide on starting from scratch.

    PS: If you have reinstalled everything by now, please let us know whether that solved the problem.
    Yes first i have try editing httpd.config file as you said, but unfortunately that doesn't solve the problem.

    I Just Re-install the Magento... 😀

    Solution that work for me:
    On the installation they ask for the host name, if you type localhost there it wont work as happened with me, so this time instead of localhost i type 127.0.0.1 and that works. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorNov 16, 2013

    So the fix is that at the time of Magento, when the installer asks for the host name, choose 127.0.0.1 instead of localhost. If you set that option, Magento admin panel works on both #-Link-Snipped-# & #-Link-Snipped-# . Please confirm.
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberNov 16, 2013

    In a way, No that wont work on the localhost now.
    But it will redirect you (everytime) to #-Link-Snipped-# if you type #-Link-Snipped-# and where that will work as we have set that host 127.0.0.1 at installation. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Romulo F. F.

    MemberAug 4, 2014

    Hello #-Link-Snipped-#
    I was trying something similar to your solution as I'mrunning Magento with wamp 2.5, but wasn't having success and receiving an error on magento install with ip adress instead of localhost.
    If anyone have this problem, check the database user, mine was specified 'machine' localhost, and i changed to 'any machine' (%).

    After reinstalling, I searched the differences too, so i think that the problem can be solved withou reinstalling doing the following operations:
    1) change app\etc\local.xml <host> from localhost to your ip adress
    2) in the database, change table 'core_config_data', change column 'path' 'value' from paths: 'web/unsecure/base_url' and 'web/secure/base_url'.
    Are you sure? This action cannot be undone.
    Cancel
  • Big_B

    MemberAug 10, 2014

    Cool! Nice Idea Romulo. Will try and post here if i find any issue. Thanks.👍
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register