Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    Default Re: Shorter version of the URL

    Not an expert but I believe that you need to enable the RewriteEngine in the mod_rewrite module before adding the Redirect 301 line.

    I'm assuming you are using Apache web server and that the Apache module 'mod_rewrite' is already enabled. As an example, in my htaccess I have

    Code:
    Options +SymLinksIfOwnerMatch
    RewriteEngine on
    
    Redirect 301 .....
    I rarely use subdirectorys like '/store/ for my sites so I can't be sure as to the correct location for this htaccess, or whether it will rewrite as

    creationcassel.com/align or creationcassel.com/store/align
    I take more of a trial and error approach if I'm unsure.
    Simon

  2. #12
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Shorter version of the URL

    And recommend that if taking a trial/error approach to first use a non-permanent designation such as a 302 until sure that it works as intended. Especially with various cache capability between the site and the customer. Once the rewrite works, then go ahead and make it a 301.

    I agree with simon1066's suggestion of at least enabling the RewriteEngine. The line above it may not be supported by the host, but is intended to provide a little bit of navigation protection.

    To address the requested rewrite, the .htaccess file would need to be at or above the directory to which the domain name is located. By above I mean that the file path would be "shorter". This way when the domain is asked to find /align, that it will start at the domain name. If it were placed in the store directory, then it wouldn't be found if first the domain name were sought/used.

    There may be some modifications necessary as can be identified by your host to ensure that the correct format is used for the environment in use.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    Default Re: Shorter version of the URL

    Quote Originally Posted by mc12345678 View Post
    And recommend that if taking a trial/error approach to first use a non-permanent designation such as a 302 until sure that it works as intended. Especially with various cache capability between the site and the customer. Once the rewrite works, then go ahead and make it a 301.
    I would recommend that a trial and error approach takes place on a test environment such as a local development server e.g. WAMPServer, XAAMP.
    Simon

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

    Default Re: Shorter version of the URL

    Quote Originally Posted by simon1066 View Post
    I would recommend that a trial and error approach takes place on a test environment such as a local development server e.g. WAMPServer, XAAMP.
    The recommendation of using a 302 instead of a 301 still applies regardless of the environment. For example if a short cut were put into the browser to use /align and then a 301 is issued, it is expected that the shortcut would get updated to the new location... and actually may want to consider always using a 302 or similar non-permanent redirect for that very reason. Ie. Published link is /align, it may point to location x for now, but later to location y. If a 301 is issued and that link updated say at a browser, then almost need to redirect the old location to the new location as well... not at all desirable to work that way. But with a 302 (or similar non-permanent redirect), the link is expected to remain as originally provided and will always be available for wherever it is modified to end up at.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #15
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,009
    Plugin Contributions
    61

    Default Re: Shorter version of the URL

    Okay in your public_html/.htaccess try this at the very top of the file

    Code:
    RewriteEngine On 
    Redirect 301 /align https://creationcassel.com/store/index.php?main_page=product_info&cPath=7_10&products_id=327
    Yes, there will be some trial and error due to different server configurations and such. I will warn you that IF you have pages in the public_html that are similar to "align" it can cause a loop.

    ~Melanie
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

  6. #16
    Join Date
    Feb 2009
    Posts
    861
    Plugin Contributions
    0

    Default Re: Shorter version of the URL

    Thank you all. Out of "curiosity", I contacted my hosting company asking if they did have any module or service to create such redirect and although they don't, there is a place in the cpanel where redirects can be created on any domain of mine, so i won't even have to use the /store/ in the url.

    So that is solved, and I am one step closer to have my book finished!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 How to make the search box shorter on the right sidebox?
    By lina0962 in forum General Questions
    Replies: 5
    Last Post: 26 Nov 2015, 05:22 PM
  2. Shorter SEO-friendly URLs
    By driven13 in forum General Questions
    Replies: 7
    Last Post: 31 Jul 2010, 08:22 AM
  3. Shorter Category Descriptions?
    By chris parker in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 6 Jan 2008, 05:05 PM
  4. Changing address bar URL's to shorter versions
    By peacefuldaze in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Dec 2007, 02:23 PM

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