Page 1 of 2 12 LastLast
Results 1 to 10 of 26

Hybrid View

  1. #1
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    red flag redirects in htacess help

    ###############################################################################
    # Add any custom 301 redirects
    hey guys trying to redirect my http:// to www or something like that just dont want duplicate content
    now i put the below code into my .htacess file and redirects work as they should but if i got to a product on my site and add to cart just brings up your shopping cart is empty and doesn't add item to cart. if i remove this redirect items will get added to cart fine anyone please help.

    ###############################################################################
    # Notes:
    #
    # In general these should be few and far between. If you use a RewriteRule
    # be sure to add the L flag to let Apache mod_rewrite know to stop processing
    # and skip any RewriteRules defined later in the .htaccess file.
    ###############################################################################
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.anarchyangels\.net
    RewriteRule (.*) http://www.anarchyangels.net/$1 [R=301,L]
    </IfModule>

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: redirects in htacess help

    Try the following
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.anarchyangels.net$
    RewriteRule ^(.*)$ http://www.anarchyangels.net/$1 [R=301]
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    thanks for the reply mate but this just returns a blank page lol you would think a 301 redirect would be easy lol frustrating

  4. #4
    Join Date
    Jun 2010
    Location
    Austria
    Posts
    115
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    The code given above should work, same one I use on sites.

    Have you made sure that in your site's /include/configure.php (frontend & admin), you are using "www.anarchyangels.net" as domain name?

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: redirects in htacess help

    Quote Originally Posted by terraGirl View Post
    The code given above should work, same one I use on sites.

    Have you made sure that in your site's /include/configure.php (frontend & admin), you are using "www.anarchyangels.net" as domain name?
    Having followed the link, the answer is no, the server information for the store side of the ZC store is set to exclude the www. Not exactly sure why the old school www. Is trying to be forced, but first ZC needs to have the uri that is expected to be had before pushing visitors to one direction or the other.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    Ok I didn't realise I had to check config.php just was putting it into the .htacess file my origianl code I got worked I got that from ZenCart instructions sure it said to put it into the htacess file is is there a guid for ZenCart to show all steps required so I don't make a mess lol thanks in advance:)

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: redirects in htacess help

    Probably need to change the red highlighted line
    Code:
    define('HTTP_SERVER', 'http://www.anarchyangels.net');
    define('HTTPS_SERVER', 'https://www.anarchyangels.net');
    define('HTTP_CATALOG_SERVER', 'http://www.anarchyangels.net');
    define('HTTPS_CATALOG_SERVER', 'https://www.anarchyangels.net');
    to
    Code:
    define('HTTP_CATALOG_SERVER', 'https://www.anarchyangels.net');
    Looks like we cross posted

    What you posted last is fine
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    So even though it says define http I put

    define('HTTP_CATALOG_SERVER', 'https://www.anarchyangels.net');
    In its place also I'm not currently using https if that makes any difference

  9. #9
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    ok so i changed that to https and now this one works

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.anarchyangels\.net
    RewriteRule (.*) http://www.anarchyangels.net/$1 [R=301,L]
    </IfModule>
    but this one below still doesn't work lol I'm sure it shouldn't be this hard lol is there anything wrong with the code that seems to be working vs
    this one

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.anarchyangels.net$
    RewriteRule ^(.*)$ http://www.anarchyangels.net/$1 [R=301]

  10. #10
    Join Date
    Feb 2016
    Posts
    58
    Plugin Contributions
    0

    Default Re: redirects in htacess help

    omg now its not working either same shopping cart issue
    think ill just have to give up starting to make me mad lol

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Htacess
    By meltdowncomics in forum General Questions
    Replies: 4
    Last Post: 9 Apr 2011, 10:39 PM
  2. Too many redirects? HELP
    By Uthernator in forum General Questions
    Replies: 1
    Last Post: 29 Sep 2010, 10:36 AM
  3. htacess settings
    By gregger in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jan 2010, 10:18 AM
  4. Help with .htacess and configure files to stop SSL redirect loop
    By behrtek in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 5 Mar 2009, 08:35 PM

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