[SOLVED] Store redirecting from localhost - Configuring & using PrestaShop - PrestaShop

Jump to content

Photo

[SOLVED] Store redirecting from localhost

#1

Posted 22 July 2011 - 02:16 AM

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1125 Active Posts
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!!!

#2

Posted 22 July 2011 - 06:22 AM

Raphaël Malié

    PrestArchitecte

  • Members
  • PipPipPip
  • 800 Active Posts
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 - CTO @ Tous Voisins http://www.tousvoisins.fr


#3

Posted 25 July 2011 - 02:30 PM

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1125 Active Posts

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.

#4

Posted 25 July 2011 - 05:36 PM

shokinro

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3617 Active Posts
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

#5

Posted 17 August 2011 - 09:52 PM

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1125 Active Posts

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

#6

Posted 17 August 2011 - 11:07 PM

shokinro

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3617 Active Posts

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

#7

Posted 19 August 2011 - 07:49 PM

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1125 Active Posts
Tried that too with same results.

#8

Posted 19 August 2011 - 09:07 PM

Arafat Jahan

    PrestaShop Apprentice

  • Members
  • PipPip
  • 43 Active Posts
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!!!


www.arafatjahan.com


#9

Posted 25 September 2011 - 01:20 PM

shykoo

    PrestaShop Apprentice

  • Members
  • PipPip
  • 45 Active Posts
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???

#10

Posted 25 September 2011 - 02:37 PM

oxyweb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 78 Active Posts
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

#11

Posted 25 September 2011 - 04:03 PM

oxyweb

    PrestaShop Apprentice

  • Members
  • PipPip
  • 78 Active Posts
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

#12

Posted 26 September 2011 - 12:57 AM

MrBaseball34

    PrestaShop Fanatic

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

#13

Posted 02 January 2012 - 04:26 AM

  • Guests
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?

#14

Posted 02 January 2012 - 04:38 AM

  • Guests

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.

#15

Posted 03 January 2012 - 08:55 PM

MrBaseball34

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1125 Active Posts

Why is this marked as SOLVED?

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

#16

Posted 12 January 2012 - 06:01 PM

szepmiki

    PrestaShop Newbie

  • Members
  • Pip
  • 1 Active Posts
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

#17

Posted 16 January 2012 - 08:26 PM

tim8nime

    PrestaShop Newbie

  • Members
  • Pip
  • 6 Active Posts
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

#18

Posted 30 May 2012 - 05:34 PM

fernandokerber

    PrestaShop Apprentice

  • Members
  • PipPip
  • 196 Active Posts

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!

#19

Posted 30 December 2012 - 12:26 PM

iggywebprom

    PrestaShop Apprentice

  • Members
  • PipPip
  • 39 Active Posts
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.


#20

Posted 11 March 2015 - 10:59 AM

robbyahn

    PrestaShop Newbie

  • Members
  • Pip
  • 1 Active Posts

Check your database table

 

ps_shop_url

 

and if you use localhost

 

domain      | domain_ssl     | physical_uri 

localhost    | localhost          /mywebsite_foldername/


Edited by robbyahn, 11 March 2015 - 11:00 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more