Forums / Upgrading to 1.5.x / Questions about my custom .htaccess file

Questions about my custom .htaccess file

Views: 1,931

Results 1 to 7 of 7
22 Jul 2017, 12:59 PM
#1
spbw avatar

spbw

New Zenner

Join Date:
Jan 2012
Posts:
50
Plugin Contributions:
0

Questions about my custom .htaccess file

V1.5.5e

On the last few versions of our shop (pre the 1.5.5e release) we had a .htaccess file when we moved from HTTP to HTTPS. There are loads of references to the HTTP address still out in the wild so the .htaccess file was helpful. I have included it now on the new version and I was wondering if I would need anything else within the file that would be helpful. Currently it is

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Options -Indexes

Thanks

22 Jul 2017, 7:28 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Questions about my custom .htaccess file

Helpful is a little vague.

If it were desirable/necessary to force all addresses to use or not use www. as a prefix more could be done/added. If wanted to block an ip address or range, that could be done, there are items that could be added to force certain features/options. Even the rewrite code provided could be done a different way (host should be able to confirm if the "best" way was chosen based on their setup of the server).

All that possibly sarcastically said, it is important that even though such a rewrite was used, that ZC should handle the navigation to the next location in the same way. Ie. All links should be https: if you are going to use that in your htaccess file.

This article describes how to accomplish that: https://www.zen-cart.com/content.php?56-how-do-i-enable-ssl-after-i-have-installed-zen-cart the end of section three has some useful information specifically related to all pages being served securely.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jul 2017, 10:52 PM
#3
spbw avatar

spbw

New Zenner

Join Date:
Jan 2012
Posts:
50
Plugin Contributions:
0

Re: Questions about my custom .htaccess file

Thanks for that.

Actually the reference states:

/**

  • Enter the domain for your Admin URL. If you have SSL, enter the correct https address in the HTTP_SERVER setting, instead of just an http address.
    /
    define('HTTP_SERVER', 'https://spbwshop.co.uk');
    /
    *
  • Note about HTTPS_SERVER:
  • There is no longer an HTTPS_SERVER setting for the Admin. Instead, put your SSL URL in the HTTP_SERVER setting above.
    */

The other config file looks as it should.

One quibble might be should it show or not show the "www" part.

Anyway, I am glad you pointed that out as, with further investigation, I find that the old test site is being referenced in both the config files - I still have the old test folder on the server. I was going to delete it now that I am live but I guess I will have to make sure that it is not mentioned elsewhere.

define('DIR_WS_CATALOG', '/test/');
define('DIR_WS_HTTPS_CATALOG', '/test/');

Apart from the config files, would there be any other place where the old test folder would be mentioned?

Thanks.

22 Jul 2017, 11:03 PM
#4
spbw avatar

spbw

New Zenner

Join Date:
Jan 2012
Posts:
50
Plugin Contributions:
0

Re: Questions about my custom .htaccess file

I ran out of editing time for the post LOL.

There is a third line:

define('DIR_FS_CATALOG', '/home/spbwshop/public_html/test/');[/QUOTE]

I will have a look tomorrow when my brain is awake.

Thanks.

22 Jul 2017, 11:42 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Questions about my custom .htaccess file

The guidance discussed about the admin side is different than what is needed for the catalog side. So I'm not sure I follow the rebuttal about the reference, but now it seems like you are looking for instruction about moving an installation from either one server to another or from one folder to another?

To a different folder: https://www.zen-cart.com/content.php?160-i-have-installed-zen-cart-to-a-directory-how-do-i-rename-or-move-that-directory

To a different server: https://www.zen-cart.com/content.php?142-i-want-to-move-my-zen-cart-installation-to-another-host-or-a-different-server

Suggest doing one or the other, then working to perform the other, but not necessarily both at the same time without first understanding what needs to be done and why...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Jul 2017, 11:56 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Questions about my custom .htaccess file

spbw:

Anyway, I am glad you pointed that out as, with further investigation, I find that the old test site is being referenced in both the config files - I still have the old test folder on the server. I was going to delete it now that I am live but I guess I will have to make sure that it is not mentioned elsewhere.

Apart from the config files, would there be any other place where the old test folder would be mentioned?

Thanks.

If all of the suggested ZC coding methods are used, the only place that anything specific about the site should be identified would be the includes/configure.php and admin/includes/configure.php files. All other content and references should be based off of the information generated from the information that "grows" from them. But there is always the possibility that a direct reference was added to support display of an image or some link within the database. Identification of that requires a little "searching".

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Jul 2017, 8:49 AM
#7
spbw avatar

spbw

New Zenner

Join Date:
Jan 2012
Posts:
50
Plugin Contributions:
0

Re: Questions about my custom .htaccess file

I am not sure how you got "rebuttal" - I was giving details for anyone else who might be in this situation.

It was a new install on a test folder, which was then linked to the existing database from the old site.

I amended the three references per config file to show '/' instead of '/test/'.
I renamed the test folder and tried the site again.
Everything seems to be working.
I can now delete the test folder

Thanks for the support.