Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Disabling Store for all But Admin?

    Hi Gang!

    Is there such a function in the zencart to disable the store for all but the administrator?
    I'd like to do some developments while presenting them with a simple generic html page. Meaning that all product pages should redirect to the root.

    Thanks.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Disabling Store for all But Admin?

    You could place the site in maintenance mode (Admin - Configuration - Maintenance) and place your IP address in the configuration so only you can access the site. You could also place a flat HTML page in the root named index.html, which will load before Zencart's index.php.

  3. #3
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Disabling Store for all But Admin?

    Thanks Steve!

    Excellent! But how about the other product pages? I'd like people who somehow have those links saved, to direct to the root of the store. Will that be possible or will they get a broken link?
    thanks

  4. #4
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Disabling Store for all But Admin?

    I think that the maintenance mode option would address those having stored a link if I remember correctly. If used the other method suggested, then I believe that they would stillbe presented the product page for example of the product in the "favorite" link if maintenance mode were off and index.html and index.php were both present. (Stored link would include index.php aas part of the path) another option I could think of is using .htaccess rules to redirect all but your ip address to the index.html file.

    Okay, enough talk about that, why is what seems like your "live" site the one being worked on and not some backup version of it?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Disabling Store for all But Admin?

    Thanks much MC -

    That makes much sense! I need this for an old version zencart, which is being re-built from scratch with the latest zc version on a different server. Once that's done, the old site will be closed down, then domain name transferred to the new server, etc. But I still want it up in case I forgot to move a product or two over.

    thanks much!

  6. #6
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Disabling Store for all But Admin?

    MC

    Do you mind letting me know how to write a redirect rule in the .htaccess of all pages to the index.html file (less my IP address)?
    thanks a lot!!
    g

  7. #7
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Disabling Store for all But Admin?

    Ok, I found a script to redirect all pages (except if coming from my IP) but it doesn't seem to be working. More than likely the redirecting rule conflicts with whatever else I have in my .htaccess.
    I can still view the pages I bookmarked. The main www.mysite.com displays the index.html correctly.

    This is what I have there now:
    Code:
    # Rewrite host name to FQDN
    RewriteCond %{HTTP_HOST} ^mysite\.com$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteRule ^.*$ http://www\.mysite\.com%{REQUEST_URI} [R=301,QSA,L]
    
    #This will produce a different robots.txt for https, blocking all files
    RewriteCond %{SERVER_PORT} 443
    RewriteRule ^robots.txt$ robots_ssl.txt [L]
    
    
    #### BOF SSU
    # For security reasons, Option followsymlinks cannot be overridden.
    #Options +FollowSymLinks
    
    RewriteEngine On
    
    # Change "/zencart/ to the correct setting
    # if your site is located at root folder, then you should have RewriteBase /
    # Go to your include/configure.php, this value should be the same with the value of DIR_WS_CATALOG
    #RewriteBase /mysite/
    
    # Deny access from .htaccess
    RewriteRule ^\.htaccess$ - [F]
    RewriteCond %{SCRIPT_FILENAME} -f [OR]
    RewriteCond %{SCRIPT_FILENAME} -d
    RewriteRule .* - [L]
    RewriteRule ^(.+) index.php/$1 [E=VAR1:$1,QSA,L]
    #### EOF SSU
    
    ##### May 30, 2014 - This is my attempt to redirect all zencat pages to index.html exept for my IP
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
    RewriteCond %{REQUEST_URI} !/index\.html$
    RewriteRule \.html$ /index.html [R=302,L]

  8. #8
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Disabling Store for all But Admin?

    Quote Originally Posted by gabstero View Post
    Ok, I found a script to redirect all pages (except if coming from my IP) but it doesn't seem to be working. More than likely the redirecting rule conflicts with whatever else I have in my .htaccess.
    I can still view the pages I bookmarked. The main www.mysite.com displays the index.html correctly.

    This is what I have there now:
    Code:
    # Rewrite host name to FQDN
    RewriteCond %{HTTP_HOST} ^mysite\.com$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteRule ^.*$ http://www\.mysite\.com%{REQUEST_URI} [R=301,QSA,L]
    
    #This will produce a different robots.txt for https, blocking all files
    RewriteCond %{SERVER_PORT} 443
    RewriteRule ^robots.txt$ robots_ssl.txt [L]
    
    
    #### BOF SSU
    # For security reasons, Option followsymlinks cannot be overridden.
    #Options +FollowSymLinks
    
    RewriteEngine On
    
    # Change "/zencart/ to the correct setting
    # if your site is located at root folder, then you should have RewriteBase /
    # Go to your include/configure.php, this value should be the same with the value of DIR_WS_CATALOG
    #RewriteBase /mysite/
    
    # Deny access from .htaccess
    RewriteRule ^\.htaccess$ - [F]
    RewriteCond %{SCRIPT_FILENAME} -f [OR]
    RewriteCond %{SCRIPT_FILENAME} -d
    RewriteRule .* - [L]
    RewriteRule ^(.+) index.php/$1 [E=VAR1:$1,QSA,L]
    #### EOF SSU
    
    ##### May 30, 2014 - This is my attempt to redirect all zencat pages to index.html exept for my IP
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
    RewriteCond %{REQUEST_URI} !/index\.html$
    RewriteRule \.html$ /index.html [R=302,L]
    Sequencing is very important. Atthe moment your newly added redirect seems to not get processed because of the redirects ahead of it. If there isno reason for the previous redirects to be processed before this newest, then the newest should go before the others. Also curious about the ip address that wwas chosen. Is this on a local install or are you accessing the web page from the server itself, or was this just an attempt to try to block yourself as a test to then enter your "rea" ip address?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Nov 2007
    Posts
    342
    Plugin Contributions
    0

    Default Re: Disabling Store for all But Admin?

    Thanks much MC!

    It worked when I popped it in front of the other redirect. The IP was just a test :-) I didn't want to block myself out. I actually wanted everyone blocked but my IP.
    thanks much!

  10. #10
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Disabling Store for all But Admin?

    Quote Originally Posted by gabstero View Post
    Thanks much MC!

    It worked when I popped it in front of the other redirect. The IP was just a test :-) I didn't want to block myself out. I actually wanted everyone blocked but my IP.
    thanks much!
    Glad it worked. Still not 100% sure why the maintenance mode was no sufficient (maintenance mode "image" can be whatever is desired including some ############## of the index.html file and it is an incorporated feature to ZC that even maintains a reminder to those that have been granted access that the site is in maintenance mode.)

    But glad it works and that the method requested to be used was achieved.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. No admin...but store shows up!
    By EC web in forum Installing on a Windows Server
    Replies: 15
    Last Post: 29 Jun 2013, 05:17 PM
  2. Admin OK but no Store
    By antoniuk in forum Installing on a Linux/Unix Server
    Replies: 11
    Last Post: 14 Feb 2008, 07:37 PM
  3. Disabling SSL login for admin post-install?
    By schwimwastaken in forum General Questions
    Replies: 2
    Last Post: 22 Dec 2007, 05:56 AM
  4. Store works but not admin
    By migzam in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 7 Dec 2007, 07:07 PM
  5. Admin accessible, but no store...
    By Triana in forum Installing on a Linux/Unix Server
    Replies: 12
    Last Post: 14 Dec 2006, 02:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR