Jump to content

Site stop working after change base url


Vinix

Recommended Posts

Hello,

I accidentally changed base url in my prestashop backoffice. I believe that I used all the ways to solve the problem, so I decided to write this post, I hope someone will be able to help me.

Version: 1.6.

What i do already?

1) define('__PS_BASE_URI__', '/'); in the /config/settings.inc.php 
2) rewrite physical_uri to "/" in DB table - ps_shop_url 
3) clear cache (cache/compile) in cache/smarty
4) upload old .htacces file (
backup when all else worked) in new .htacces frontoffice generate 500 error.

After all steps: frontoffice was working (not tested all) for now, but i can't login to backoffice i write login and password, after 2 seconds nothing happen, login and password input was clear. Any idea how i can fix it? And what i can change more? It is any possibility to generate .htaccess manualy? When i delete .htaccess url was still like that www.example.com/example/ (that "/example/" was base url) and generate 404 not found. I will be grateful for any help

Best.

Link to comment
Share on other sites

Hello,

 

I accidentally changed base url in my prestashop backoffice. I believe that I used all the ways to solve the problem, so I decided to write this post, I hope someone will be able to help me.

 

Version: 1.6.

 

What i do already?

 

1) define('__PS_BASE_URI__', '/'); in the /config/settings.inc.php 

2) rewrite physical_uri to "/" in DB table - ps_shop_url 

3) clear cache (cache/compile) in cache/smarty

4) upload old .htacces file (backup when all else worked) in new .htacces frontoffice generate 500 error.

 

After all steps: frontoffice was working (not tested all) for now, but i can't login to backoffice i write login and password, after 2 seconds nothing happen, login and password input was clear. Any idea how i can fix it? And what i can change more? It is any possibility to generate .htaccess manualy? When i delete .htaccess url was still like that www.example.com/example/ (that "/example/" was base url) and generate 404 not found. I will be grateful for any help

 

Best.

 

To regenerate .htaccess you have to disable/enable rewrite URLs in "Preferences -> SEO & URLs".

 

About your BO problem, have you tried to remove cookies?

Link to comment
Share on other sites

Hello,

Thanks for reply, as i say i can't login at this moment to BO:

 

 

After all steps: frontoffice was working (not tested all) for now, but i can't login to backoffice 


I tried, but im sure it's base url problem, all the way i have www.example.com/example/ (example was baseUrl), FO start working after add "define('__PS_BASE_URI__', '/'); in the /config/settings.inc.php". 

Link to comment
Share on other sites

You can make a direct change into the database if you backoffice does not work. However prior to that I recommend to revert changes in your .php files you might have made.

The tables relevant for the change are:

 

ps_shop_url 

=> fields domain and domain_ssl  => no protocol prefix => example: mydomain.com

=> field physical_url => example: /

 

ps_configuration

=> keys: PS_SHOP_DOMAIN and PS_SHOP_DOMAIN

=> same values in ps_shop_url

Link to comment
Share on other sites

Sorry, I did not have time to take care of the site. Problem was still not solved, for now i have some time to fix it.

 

You can make a direct change into the database if you backoffice does not work. However prior to that I recommend to revert changes in your .php files you might have made.

The tables relevant for the change are:

 

ps_shop_url 

=> fields domain and domain_ssl  => no protocol prefix => example: mydomain.com

=> field physical_url => example: /

 

ps_configuration

=> keys: PS_SHOP_DOMAIN and PS_SHOP_DOMAIN

=> same values in ps_shop_url

I check again your soltuion, all right in my DB. Also i revert changes on:
define('__PS_BASE_URI__', '/'); in the /config/settings.inc.php 

Also deleted .htaccess, still can't get access to BO. When i write right acc & pass site reloading for 2-3 seconds and all inputs was clear. When i write wrong acc & pass i see:

"There is 1 error.

The Employee does not exist, or the password provided is incorrect."

So i have connection with DB. After delete .htaccess and revert changes in /config/settings.inc.php  i don't have access to FO, site URL was still bad, https://example.com/example.com/ and i see this communicate:

"Not Found
The requested URL /example.com/ was not found on this server."

Console errors (login in BO):

With .htaccess (/var/www/prestashop/)
34ydwg1.jpg
 
 
Without .htaccess
20ge8af.jpg

Tested in google chrome, firefox, opera. Any ideas? 

@Edit
I also tried old solution from this topic:
https://www.prestashop.com/forums/topic/240899-uncaught-referenceerror-jquery-is-not-defined/
Without good results.

Regards.
Edited by Vinix (see edit history)
Link to comment
Share on other sites

  • 2 years later...
On 9/18/2017 at 9:06 PM, Scully said:

Your javascript isn't loading for some reason. Difficult to say what went wrong with all this changes.

@Scully hi Scully, I read your information on this topic. I messed up similarly. I really hope you can help me, as I changed the base url in backoffice by accident and now shop is gone and I cannot login to admin BO anymore 😞

 

Where can I undo this or rectify this (I have ftp access to my files) - I am using prestashop 1.7 - so the /config/settings.inc.php is deprecated ... sorry to bother you, but I'm in desperate search for help. thanks  alot

  • Like 1
Link to comment
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
×
×
  • Create New...