Jump to content

[SOLVED] Problem with htaccess


Recommended Posts

Hello. My Prestashop version is 1.4.11.0. I finished the site and I want to remove the password protected directory. I have public_html folder protected. I need to remove it. I tried deleting the user in Cpanel and some tutorials but nothing happens. The prompt/pop up continues appearing when I type the website name www.celma.com.ve. My hosting provider said me: add this to your htaccess file: 

<Directory /var/www/protected/>
AuthType Basic
AuthName "Production"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Directory>

<Directory /var/www/protected/unprotected>
Satisfy Any
</Directory>

But when exactly I have to add that? 

This is my htaccess file:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums


<IfModule mod_rewrite.c>
# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
</IfModule>

# Catch 404 errors
ErrorDocument 404 /404.php

PLEASE HELP ME.

Edited by Maurizio Fabbri (see edit history)
Link to comment
Share on other sites

You need to put it above this, 

 

 

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums

 

Anything you add to your htaccess file must go above the warning, everything you add below that we be overwritten as you make changes to your web site.

Link to comment
Share on other sites

Thank you for your answer Bill. So, it would be this:

<Directory /var/www/protected/>
AuthType Basic
AuthName "Production"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Directory>

<Directory /var/www/protected/unprotected>
Satisfy Any
</Directory>

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums


<IfModule mod_rewrite.c>
# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
</IfModule>

# Catch 404 errors
ErrorDocument 404 /404.php

Won't this cause any damage? sure I can click on save changes?

  • Like 1
Link to comment
Share on other sites

My Hosting Provider said me: "if that does not work, try deleting the account completely (all the website), and create it again and upload all the files to the public_html again and upload the database. So, I did it. I made a backup, deleted the account in the WHM and created it again. www.celma.com.ve. I uploaded all the website files and folders to public_html in Cpanel and uploaded the database to phpmyadmin, after "create the database" in MySql databases with the same name. I couldn't import the database because when I tried it showed a red message saying something related with time, "execution time passed..." or something like that and just 29 tables of it were imported. And the database has more than 100 tables. The database is really small, only 1 Mb. My Hosting Provider helped me to import it, but when I opened the phpmyadmin I saw the same I had seen when I tried (just 29 tables of the database). Now we see this when trying to access to the site: Bad SubDomain SQL query. So, Why? What happened? You can see the error message here --> www.celma.com.ve. How can I solve this? Where is my site? cooperate with me, help me please.

Edited by Maurizio Fabbri (see edit history)
Link to comment
Share on other sites

First, you should not need to delete everything it turn off your login problem. If your host told you to delete everything that was CRAZY.

 

It sounds like you were getting an error message related to PHP script execution time. Your host had your PHP permissions set to low.

 

My advise is to get a new host.

Link to comment
Share on other sites

Patron thank you very much for your concern. Did you read the paragraph (the big paragraph) which begins: "My Hosting Provider said me: "if that does not work, try..."...  up here in this topic, answering to Bill Dalton and tuk66?

 

I do agree with Mr. Dalton, i.e. crazy of hosting to suggest deleting and re-uploading.

 

You will need to resolve importing the db to resolve that issue before proceeding (sorry I did not read the original longer post more carefully).

 

If you are not able to upload via phpmyadmin, I suggest contacting your hosting company to help...as that is beyond what can be accomplished here by us.

Link to comment
Share on other sites

Patron. What do you think about this? http://www.reboot.ro/tutorials/how-to-solve-bad-subdomain-sql-query-on-prestashop-update-from-1-4-x-to-1-5-x/

 

Zeepshop sent me that. He said me to try it, to solve the issue. What's your opinion? I know I have to solve phpmyadmin problem first. Because the database is not complete.

Edited by Maurizio Fabbri (see edit history)
Link to comment
Share on other sites

I changed config/config.inc.php

  1. /* Debug only */
  2. @ini_set('display_errors', 'on');
  3. define('_PS_DEBUG_SQL_', true);

 

And I get this: 

 

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in /home/fecelma/public_html/classes/Db.php on line 611

 

NOTE: The database is not complete, I tried to upload it several times and nothing. It should be 165 tables more or less. And just uploades 29, 39 or 65 tables. I don't know what is happening with phpmyadmin.

 

RED ERROR MESSAGE in phpmyadmin when trying to upload the database: something like....

 

"It has timed script execution, if you want to finish import resubmit same file and import will resume."

 

I changed again 

  1. /* Debug only */
  2. @ini_set('display_errors', 'on');
  3. define('_PS_DEBUG_SQL_', true);

and still the message: Bad SubDomain SQL query.

Edited by Maurizio Fabbri (see edit history)
Link to comment
Share on other sites

 

Still not. I am trying right now. I changed this file:

I added memory_limit=256M;

register_globals=off
max_input_vars = 10000;
suhosin.get.max_vars = 10000;
suhosin.post.max_vars = 10000
memory_limit=256M;

Nothing, it uploaded just 39 tables. 

Error Message: "Se ha agotado el tiempo de ejecución del script; si desea completar la importación reenvíe el mismo archivo y la importación continuará."

Link to comment
Share on other sites

Nothing, it uploaded just 39 tables. 

Error Message: "Se ha agotado el tiempo de ejecución del script; si desea completar la importación reenvíe el mismo archivo y la importación continuará."

 

please contact your hosting company to help with getting db loaded.  They should have never told you to delete and start over...ave maria pues

Link to comment
Share on other sites

please contact your hosting company to help with getting db loaded.  They should have never told you to delete and start over...ave maria pues

I am driving me crazy. They take too long, too long to respond. I tried again uploading the database, and now it uploaded 75 tables. 10 more. 90 missing.... more or less.

Edited by Maurizio Fabbri (see edit history)
Link to comment
Share on other sites

SOLVED!!!!!!!!! , I finally restored the database!!!!!!!!!! after 100 attempts more or less!! thank you very much El Patron, thank you Bill Dalton, thank you tuk66, thank you to Zeepshop, thank you to all for your help and concern!. Thank you so much! Now I just would like to know how to accelerate/speed up the site.

  • Like 1
Link to comment
Share on other sites

SOLVED!!!!!!!!! , I finally restored the database!!!!!!!!!! after 100 attempts more or less!! thank you very much El Patron, thank you Bill Dalton, thank you tuk66, thank you to Zeepshop, thank you to all for your help and concern!. Thank you so much! Now I just would like to know how to accelerate/speed up the site.

 

that's great news!...and you learned thing that will serve you well in the future. 

Link to comment
Share on other sites

Hello. My Prestashop version is 1.4.11.0. I finished the site and I want to remove the password protected directory. I have public_html folder protected. I need to remove it. I tried deleting the user in Cpanel and some tutorials but nothing happens. The prompt/pop up continues appearing when I type the website name www.celma.com.ve. My hosting provider said me: add this to your htaccess file: 

<Directory /var/www/protected/>
AuthType Basic
AuthName "Production"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Directory>

<Directory /var/www/protected/unprotected>
Satisfy Any
</Directory>

But when exactly I have to add that? 

This is my htaccess file:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# WARNING: PLEASE DO NOT MODIFY THIS FILE MANUALLY. IF NECESSARY, ADD YOUR SPECIFIC CONFIGURATION WITH THE HTACCESS GENERATOR IN BACK OFFICE
# http://www.prestashop.com - http://www.prestashop.com/forums


<IfModule mod_rewrite.c>
# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^api/?(.*)$ /webservice/dispatcher.php?url=$1 [QSA,L]
</IfModule>

# Catch 404 errors
ErrorDocument 404 /404.php

PLEASE HELP ME.

[sOLVED]

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...