Vote for v1.5 Fixes

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content

Photo

[SOLVED] Store redirecting from localhost


  • Please log in to reply
18 replies to this topic
MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 22 July 2011 - 02:16 AM

I am using a WAMP setup, documentroot = g:\wamp\www

PS installed in folder g:\wamp\www\prestashop_1.4.1

When I type in http://localhost/prestashop_1.4.1, it redirects me to
http://www.mystore.c...tashop_1.4.1/en
(mystore.com is not my real url)

I have this in settings.inc.php:
define('__PS_BASE_URI__', '/prestashop_1.4.1/');

I have:
PS_SHOP_DOMAIN = /localhost/prestashop_1.4.1
PS_SHOP_DOMAIN_SSL = /localhost/prestashop_1.4.1

NO .htaccess file in store directory. Searched for instances of mystore.com in all php files in directory tree, none found.
Searched every table in DB, no instances found.

Even when I type in http://127.0.0.1/prestashop_1.4.1, it redirects me to the same thing as above.

Funny thing is, if I want to access the BO, this URL works with no redirection:
http://localhost/pre...4.1/store_admin

What the heck else should I check to be able to run this thing on localhost? I'm pulling out the rest of my hair, I can't think of anything else and I need to know this like NOW!!!

Raphaël Malié

    PrestArchitecte

  • Members
  • PipPipPip
  • 791 posts

Posted 22 July 2011 - 06:22 AM

Hi, open your file c:\windows\system32\drivers\etc\host and check that you have the line uncommented :
127.0.0.1       localhost

Ex-PrestaShop Core Developer - WorldAside Co-Founder - Github - Twitter

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 25 July 2011 - 02:30 PM

Hi, open your file c:windowssystem32driversetchost and check that you have the line uncommented :<br/>

127.0.0.1       localhost

It is just fine, if it was not correct, I wouldn't be able to access the BO.

shokinro

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3595 posts

Posted 25 July 2011 - 05:36 PM

is the database you running on restored from bakcup which was running at "http://www.mystore.c....tashop_1.4.1/" before?

In that case, you need to change the domain name in the datbase table ps_configuration

check my blof here for more details
Multiple Seller/Multiple Shop | Marker Place Solution | Online Mall Solution | Paypal Express | Paypal Parallel | Authorize.NET | Membership management | Pickup location (Google maps) | Product Reviews | Affiliate/Refferal | News Letter | PrestaShop Modules | Follow us at Twitter | Like us on Facebook

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 17 August 2011 - 09:52 PM

is the database you running on restored from bakcup which was running at "http://www.mystore.c....tashop_1.4.1/" before?

In that case, you need to change the domain name in the datbase table ps_configuration

check my blof here for more details


I have (in the database):
PS_SHOP_DOMAIN = /localhost/prestashop_1.4.1
PS_SHOP_DOMAIN_SSL = /localhost/prestashop_1.4.1

shokinro

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3595 posts

Posted 17 August 2011 - 11:07 PM

I have (in the database):
PS_SHOP_DOMAIN = /localhost/prestashop_1.4.1
PS_SHOP_DOMAIN_SSL = /localhost/prestashop_1.4.1

Domain name should only contain the domain name part, not include the virtual directory.

So in your case it should be in database

PS_SHOP_DOMAIN localhost
PS_SHOP_DOMAIN_SSL ocalhost


Multiple Seller/Multiple Shop | Marker Place Solution | Online Mall Solution | Paypal Express | Paypal Parallel | Authorize.NET | Membership management | Pickup location (Google maps) | Product Reviews | Affiliate/Refferal | News Letter | PrestaShop Modules | Follow us at Twitter | Like us on Facebook

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 19 August 2011 - 07:49 PM

Tried that too with same results.

Arafat Jahan

    PrestaShop Apprentice

  • Members
  • PipPip
  • 39 posts

Posted 19 August 2011 - 09:07 PM

Hi,

try to go "Back Office>Preferences>SEO & URLs" then scroll down and find the tab "URLs Setup"

in this section you need to define your:-
PS directory = /prestashop_1.4.1/
Homepage file = index.php
Shop domain name = http://localhost/prestashop_1.4.1
Shop domain name for SSL = https://localhost/prestashop_1.4.1


Please be confirm that you delete your .htaccess file from ROOT folder /prestashop_1.4.1/ when you are in local server, [be sure backup your .htaccess file before delete]

May be it will help, also be sure to turn off friendly-url when you are on your local server.

If it solve your problem then please mark the post as [SOLVED] as other people can get help

thanks,
Arafat Jahan

I am using a WAMP setup, documentroot = g:\wamp\www

PS installed in folder g:\wamp\www\prestashop_1.4.1

When I type in http://localhost/prestashop_1.4.1, it redirects me to
http://www.mystore.c...tashop_1.4.1/en
(mystore.com is not my real url)

I have this in settings.inc.php:

define('__PS_BASE_URI__', '/prestashop_1.4.1/');

I have:
PS_SHOP_DOMAIN = /localhost/prestashop_1.4.1
PS_SHOP_DOMAIN_SSL = /localhost/prestashop_1.4.1

NO .htaccess file in store directory. Searched for instances of mystore.com in all php files in directory tree, none found.
Searched every table in DB, no instances found.

Even when I type in http://127.0.0.1/prestashop_1.4.1, it redirects me to the same thing as above.

Funny thing is, if I want to access the BO, this URL works with no redirection:
http://localhost/pre...4.1/store_admin

What the heck else should I check to be able to run this thing on localhost? I'm pulling out the rest of my hair, I can't think of anything else and I need to know this like NOW!!!



shykoo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 posts

Posted 25 September 2011 - 01:20 PM

I have the same issue. this post has the [solved] mark, but though i have tried everything suggested, including the final post by Arafat Jahan, I am still redirected to the live URL of myshop. In BO>SEO&URLs i tried all possible combinations, even left it blank, but still nothing. What the NECK!!! MrBaseball34 - how did u solve it???

oxyweb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 78 posts

Posted 25 September 2011 - 02:37 PM

shykoo I'm also having the same problem.

I didn't what you to think that the end of this paragraph will be an answer so I thought I would but the above disclaimer first! Anyway, I'm having the same problem and I've done exactly what has been mentioned and still no change. It's a bizarre thing! There's no link between the localhost and the onlinestore but still clicking on View My Shop or going to http://localhost/shop will always redirect to my onlinestore. hmmm... anyway if I figure it out I will let you know!

BTW Did you clear the cache and cookies in your browser?

MrB What did you do?!
Using 1.4.8.2

oxyweb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 78 posts

Posted 25 September 2011 - 04:03 PM

Thank you to Arafat, he had it right!

1. Delete the .htaccess file - don't regenerate it!

2. Set the shop folder like this:

Posted Image


3. After this, test the site and regenerate the htaccess file if you wish (it did work for me).

4. Switch Friendly URL back on and regenerate the ht access file and it will work jsut as the online site.
Using 1.4.8.2

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 26 September 2011 - 12:57 AM

I solved it by rebuilding my store. I got tired of waiting for a correct solution. Faster, sometimes, to start from square one.

  • Guests

Posted 02 January 2012 - 04:26 AM

Hi there,

I am having the same problem on my PS 1.4.6, It was okay before I tried to use the Friendly URL on my Localhost's PS.

I have tried to changed the URL in ps_configuration and in 'BO-..Shop domain name' to "localhost" and 'localhost/mysite' to no avail.

Why is this marked as SOLVED?

  • Guests

Posted 02 January 2012 - 04:38 AM

Thank you to Arafat, he had it right!

1. Delete the .htaccess file - don't regenerate it!

2. Set the shop folder like this:

Posted Image


3. After this, test the site and regenerate the htaccess file if you wish (it did work for me).

4. Switch Friendly URL back on and regenerate the ht access file and it will work jsut as the online site.



A little more: Do all the above+remove .htaccess file in your prestashop root + make sure there's no live site url in your database + restart your server(XAMP, WampServer) That's how I fixed this issue on my localhost site.

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1123 posts

Posted 03 January 2012 - 08:55 PM

Why is this marked as SOLVED?

Because it was solved. It was *my* post and *I* solved it by rebuilding my store.

szepmiki

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts

Posted 12 January 2012 - 06:01 PM

Hi,

I've got the same problem (MrBaseball34 #1). My solution was:
Add the next line to /etc/hosts file (Ubuntu, but may be similar on other systems):
'127.0.0.1 localhost/myprestashopdir myshopdomain'
where myshopdomain is the domain name you give "Back Office>Preferences>SEO & URLs> URLs Setup>Shop domain name"
In this case you don't need to regenerate .htaccess and not need to do do anything in the shops preferences.

Note: if myshopdomain is a live domain you can not reach the live site while this line is in hosts, but works fine when you host your live site on your local machine and you want to access the live site on your localhost

tim8nime

    PrestaShop Newbie

  • Members
  • Pip
  • 6 posts

Posted 16 January 2012 - 08:26 PM

I had the same problem and I found that just changing values in the database (in the ps_configuration table) did the trick:

id_configuration : name = value

178 : PS_SHOP_DOMAIN = localhost
179 : PS_SHOP_DOMAIN_SSL = localhost
216 : REVERSO_ADDRESS = localhost

fernandokerber

    PrestaShop Apprentice

  • Members
  • PipPip
  • 196 posts

Posted 30 May 2012 - 05:34 PM

I had the same problem and I found that just changing values in the database (in the ps_configuration table) did the trick:

id_configuration : name = value

178 : PS_SHOP_DOMAIN = localhost
179 : PS_SHOP_DOMAIN_SSL = localhost
216 : REVERSO_ADDRESS = localhost


THANK YOU!

iggywebprom

    PrestaShop Apprentice

  • Members
  • PipPip
  • 35 posts

Posted 30 December 2012 - 12:26 PM

when copiyng my site (prestashop 1.4) to localhost, I changed in database:
PS_SHOP_DOMAIN = localhost
PS_SHOP_DOMAIN_SSL = localhost

In my shop directory: config/settings.inc.php - first line:
define('__PS_BASE_URI__', '/my shop folder name on wamp root/');

Then also disabled .htaccess and in db also set rewrite to 0
PS_REWRITING_SETTINGS = 0
Now it works ok on localhost : :)

Edited by iggywebprom, 30 December 2012 - 12:27 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users