Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36
  1. #11
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    Quote Originally Posted by DK_Scully View Post
    I'll try it! Which copy of .htaccess should I modify? So far the only copy I've found is in the /includes/ folder,
    EXCELLENT. Well done - I've finally found someone with a ZenCart website working and functioning as designed. :-)

    So, to answer your question, you will need to create an .htaccess file and place it in the 'root' folder of your store (this is the same place that you'll find the favicon, robots.txt, ipn_man_handler.php and several other files).

    In addition to the two lines already given, since this is a new .htaccess file you will probably need to add the following two lines at the start of the file

    Options +FollowSymLinks
    RewriteEngine on

    The +FollowSymlinks probably isn't required - but most of the code examples I've just looked at seems to have it.

    After you have confirmed that the two example redirects work (by typing the one to be redirected into your web browser) you *may* need to add additional rules for possible variants - This is especially true if your categories are nested - For example if that category '17' is a subcategory of category '1' you will find that both

    index.php?main_page=index&cPath=17
    and
    index.php?main_page=index&cPath=1_17
    both load the same page and depending on how the site is navigated either or both can be generated by Zencart - As such, you will need a redirect for both.

    Although it is also possible to replace the 'simple redirect' with a 'RedirectMatch' which will enable the use of REGEX like expressions to cater for both variants with a single rule it isn't something I'd recommend at this stage, because it can be too easy to create a REGEX (Regular Expression) that will match things you don't want matched.

    Please note, that I'm no expert in the syntax of any of the .htaccess rules. I tend to only use them to allow/deny access (coincidental name or what?) ;-)

    In the times I need to know how to write a rule, I use Google to find a generator that crates them for me, then I just do a copy/paste. I even did this to provide you with the two examples already given :)

    Anyway, I'm ranting again... start simple... extend as/when needed.

    Tip: If you mess up the .htaccess rules (especially syntax errors) you *will* crash your site (typically a 'Server 500 error'). This is nothing to panic about - simply delete the file (or added rules) and redo.

    There is no need to restart the server or clear any caches for changes to the .htaccess file to come into effect - The file is re-read with each and every page request - so its a matter of "stuff ups and fixes while you watch" so it is very easy to test/check that all is working as expected.

    Cheers
    RodG
    Last edited by RodG; 28 Jan 2016 at 08:17 AM.

  2. #12
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    I thought you said this was easier!! LOL

    Okay, let me pick my way through it and see if I can figure it out...........

  3. #13
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    Quote Originally Posted by DK_Scully View Post
    I thought you said this was easier!! LOL

    Okay, let me pick my way through it and see if I can figure it out...........
    My apologies, I think I may have made it appear a little overcomplicated this time around.

    I'll try again. Using the two category examples that you originally gave you'll need one redirect rule for each, plus the additional line "rewrite engine on" and *maybe* the "followsymlinks"

    Everything beyond that is on an *if needed* basis.

    Cheers
    RodG

  4. #14
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    We had another site that needed category redirects created, so I tried your .htaccess suggestion. It did...absolutely nothing, to be honest.

    I started with the one in /includes/ and removed everything below the ## line, then added in the lines you recommended. The end product is:

    Code:
    #
    # @copyright Copyright 2003-2013 Zen Cart Development Team
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    # @version GIT: $Id: Author: IronLady  Thu Aug 1 16:10:02 2013 +0100 Modified in v1.5.2 $
    #
    # This is used with Apache WebServers
    #
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
    # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
    # Will also prevent people from seeing what is in the dir. and any sub-directories
    #
    # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
    # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
    # Example:
    #<Directory "/usr/local/apache/htdocs">
    #  AllowOverride Limit Options Indexes
    #</Directory>
    ###############################
    
    
    Options +FollowSymLinks
    RewriteEngine on
    
    Redirect 301 /index.php?main_page=index&cPath=342 http://www.timelesserotica.com
    Redirect 301 /index.php?main_page=index&cPath=343 http://www.book-oasis.com

    Obviously I'm missing something. Help, please?

  5. #15
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    Quote Originally Posted by DK_Scully View Post
    Obviously I'm missing something. Help, please?

    "you will need to create an .htaccess file and place it in the 'root' folder.."


    Cheers
    RodG



  6. #16
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    This is on a shared server with many other websites. I put it in the root folder for that site. I even tried changing the path so it says /zencart/index.php?main_page=index&cPath=343 http://www.book-oasis.com since the zencart program is in a folder. Nothing works.
    Last edited by DK_Scully; 11 Jun 2017 at 12:52 PM.

  7. #17
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    Quote Originally Posted by DK_Scully View Post
    This is on a shared server with many other websites.
    Most are. :)
    Quote Originally Posted by DK_Scully View Post
    I put it in the root folder for that site.
    Correct (I thought I detailed that earlier?)

    Quote Originally Posted by DK_Scully View Post
    I even tried changing the path so it says /zencart/index.php?main_page=index&cPath=343 http://www.book-oasis.com since the zencart program is in a folder. Nothing works.
    This may or may not be right, it really depends of the perspective of the server, and more specifically, the defined document root.

    I would suggest that you be smart here, and use the tools available to you. Assuming you have cPanel, and also assuming you know what you want to redirect, and where you wish to redirect, log into the cPanel, find the Redirect tool, then just enter the data. Heck, don't even try typing it. First go the the page you want redirected - copy its URL Now got to where you want to end up. Copy its URL. Now just paste that into the relevant fields and save.

    The only difference between this method and the .htaccess method is none. It is the same method. It just that using the cPanel tool ensures that you are editing the *right* .htaccess file, and also prevents you from making other syntax errors that can occur with manual edits.

    Cheers
    RodG

  8. #18
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    That didn't work, either. I selected the proper website name, and added zencart/index.php?main_page=index&cPath=343 in the second field. It created a redirect, but it didn't take the full url. Instead, it cut it off at www.carnal-pleasures.com/zencart/index.php and won't take the remainder. So of course it won't refresh anything. Any other suggestions? Thanks!

  9. #19
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,904
    Plugin Contributions
    13

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    post the url of the site as well as the contents of the .htaccess file.

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

    Default Re: What's The Easiest Way To Create A Direct Link In The Sidebox?

    Might I suggest that until the to/from is correctly applied or identified that you use a 302 instead of a 301? (ie. A temporary move instead of a permanent move?) almost no telling how many different uris/servers have been redirected permanently for a "test".
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. The Quickest and Easiest way to work out what does what on the CSS style sheet
    By janissaire in forum Templates, Stylesheets, Page Layout
    Replies: 47
    Last Post: 5 Jul 2012, 03:05 AM
  2. What's the easiest way to add custom fields to the New Product page?
    By christopherw in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 18 Sep 2007, 06:16 PM
  3. What is the easiest way to add an extra sidebox and make some html pages in it?
    By hankliu in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 27 Dec 2006, 10:48 AM
  4. Whats the easiest way to create a newsletter??
    By Diva in forum General Questions
    Replies: 5
    Last Post: 27 Jul 2006, 09:08 AM
  5. Shipping, what is the easiest way
    By jcoit1 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 11 Jul 2006, 01:49 AM

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