Jump to content
  • 0
MrBaseball34

[SOLVED] Store redirecting from localhost

Question

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.com/prestashop_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/prestashop_1.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!!!

Share this post


Link to post
Share on other sites

23 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites
  • 0

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.com/prestashop_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/prestashop_1.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!!!

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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?!

Share this post


Link to post
Share on other sites
  • 0

Thank you to Arafat, he had it right!

 

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

 

2. Set the shop folder like this:

 

viGjU.png

 

 

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.

Share this post


Link to post
Share on other sites
  • 0
Guest   
Guest

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?

Share this post


Link to post
Share on other sites
  • 0
Guest   
Guest

Thank you to Arafat, he had it right!

 

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

 

2. Set the shop folder like this:

 

viGjU.png

 

 

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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!

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

Check your database table

 

ps_shop_url

 

and if you use localhost

 

domain      | domain_ssl     | physical_uri 

localhost    | localhost          /mywebsite_foldername/

Edited by robbyahn

Share this post


Link to post
Share on other sites
  • 0

hello,

 

i have also an redirecting problem.

did al this above but stil s my new server: 149.210.180.226 going to the old server place www.mypartsplace.nl

and also 149.210.180.226/backoffice is redirecting to the homepage.

 

i changed the domain and domain_ssl in mysql to 149.210.180.226

 

and also in settings.inc.php  :  define('__PS_BASE_URI__', '/siteapps/Prestashop-253594/htdocs');

 

does some have a sollution?

 

thanks in advance 

Share this post


Link to post
Share on other sites
  • 0

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 : smile.png

 

I'm trying to install locally on my pc the e-commerce: http://my-ecommerce.

 

I've done these configurations:

  - PS_SHOP_DOMAIN = localhost

  - PS_SHOP_DOMAIN_SSL = localhost

  - define('__PS_BASE_URI__', '/my shop folder name on wamp root/');

  - removed the file .htaccess in the root folder of the site

  - PS_REWRITING_SETTINGS = 0

 

But still the URL http://localhost/prestashop/ it is redirected to http://my-ecommerce.

 

I'm using Prestashop 1.6.1.6, is there a new guide to move locally an ecommerce?

 

So I think this issue is not yet solved.

 

cld

Edited by ilclaudio

Share this post


Link to post
Share on other sites
  • 0

I'm trying to install locally on my pc the e-commerce: http://my-ecommerce.

 

I've done these configurations:

  - PS_SHOP_DOMAIN = localhost

  - PS_SHOP_DOMAIN_SSL = localhost

  - define('__PS_BASE_URI__', '/my shop folder name on wamp root/');

  - removed the file .htaccess in the root folder of the site

  - PS_REWRITING_SETTINGS = 0

 

But still the URL http://localhost/prestashop/ it is redirected to http://my-ecommerce.

 

I'm using Prestashop 1.6.1.6, is there a new guide to move locally an ecommerce?

 

So I think this issue is not yet solved.

 

cld

 

Hi guys,

at the end I've solved modifying this table too:

 

Table: ps_shop_url

domain          --> localhost

domain_ssl   --> localhost

physical_uri --> my-ecommerce

 

Now the site works locally.

 

cld

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×