1

I am new to Magento and I am trying to change the address where my public ip directs, but honestly do not quite know how to do it. So if anyone could lend a hand it would be much appreciated.

I have an ip, let´s say http://12.34.456.89/ and when I navigate to it from browser I end up in the first magento page (Concratulations You are now running Bitnami Magento 1.9.0.1-0 virtual appliance. blaa, blaa), but I would need it redirect into http://12.34.456.89/magento/ where the actual store resides.

How can I make the the redirection so, that upon entering http://12.34.456.89/ on the browser, user will end up on http://12.34.456.89/magento ?

Many thanks for helping a newbie out.

1
  • you mean on your local system?
    – MTM
    Jul 18, 2014 at 6:53

2 Answers 2

2

If you are asking for your local system, for Windown go to C:\Windows\System32\drivers\etc and edit hosts file in Notepad. You need to run the Notepad as Administrator.

In Ubuntu the path is /etc/hosts, edit this file in your editor like VIM as a root so use the command sudo vim /etc/hosts

Both OS will require to add a line in the file as

12.34.456.89 12.34.456.89/magento

Note a space between both. whatever you write before space is request and whatever is after the space is the target. save the file and try the request part. I hope it will redirect to the target.

6
  • Sorry, no I am asking for Ubuntu server.
    – Houhou
    Jul 18, 2014 at 6:59
  • in Ubuntu the path is /etc/hosts
    – MTM
    Jul 18, 2014 at 7:02
  • @MTM. Are you sure that it will work by editing the hosts? I think you need to change the document root, or you need an htaccess redirect, but not sure...that's why I'm asking.
    – Marius
    Jul 18, 2014 at 7:06
  • @Marius, he asked for Ubuntu server, and i guess server uses host file
    – MTM
    Jul 18, 2014 at 7:09
  • @Marius, you may be right, i am removing my answer. :)
    – MTM
    Jul 18, 2014 at 7:17
1

if you are using ubuntu server... with

nignx - goto nginx default.conf and edit the line or a similar method for .htaccess in apache

 server {
    listen       80;
    server_name  yourname.com or ip address;



    location / {
      root   /usr/share/nginx/html; # change the root directory to magento directory
        index  index.php index.html index.htm;
    } 

or you can simply create index.php file in you current directory and use redirect method...

<?php header('location:magento/'); ?>

But it is not the recommended way

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.