ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

301 redirect issue

July 27, 2012 4:05pm

Subscribe [2]
  • #1 / Jul 27, 2012 4:05pm

    ianryde

    112 posts

    Hi all,

    I’m trying to redirect alot of urls using the 301 method in my htaccess files.

    But When i do it, it seems to fall over:

    Redirect 301 “/batteries-suitable-for/clocks/duracell-plus-power-mn2400-aaa-pack-of-4-2-free/” http://www.houseofbatteries.co.uk/products/duracell-plus-power-mn2400-aaa-pack-of-4-2/

    The result of the redirect is this…

    http://www.houseofbatteries.co.uk/products/duracell-plus-power-mn2400-aaa-pack-of-4-2-free?/batteries-suitable-for/clocks/duracell-plus-power-mn2400-aaa-pack-of-4-2-free/

    Which is rather odd. Can anyone help?

    Thanks,
    Ian

  • #2 / Jul 30, 2012 11:56am

    Shane Eckert

    7174 posts

    Hey Ian,

    I am sorry to hear you are running into this problem.

    We do not support custom htaccess files aside from the one we list on the site.

    I would love to move this thread over to the Community Help Forum for you to get some help from the community.

    What do you think?

    Cheers,

  • #3 / Jul 30, 2012 1:07pm

    MadWebDesigns

    147 posts

    Hi Ian,

    Can you post the entire contents of your htaccess file so we can have a look?

    Thank you,

    Mike

  • #4 / Aug 24, 2012 12:00pm

    ianryde

    112 posts

    sure:

    #—NSM .htaccess Generator Start—
    # .htaccess generated by NSM .htaccess Generator v1.1.5
    # @see: http://ee-garage.com/nsm-htaccess-generator

    php_value memory_limit 256M

    # For more awesome .htaccess rules and optimisations
    # checkout the HTML5 Boilerplate .htaccess files
    # https://github.com/paulirish/html5-boilerplate/blob/master/.htaccess

    # Although highly unlikely, your host may have +FollowSymLinks enabled at the root level,
    # yet disallow its addition in .htaccess; in which case,
    # adding +FollowSymLinks will break your setup (probably a 500 error),
    # so just remove it, and your rules should work fine.
    Options +FollowSymlinks

    # EE 404 page for missing pages
    # ErrorDocument 404 /index.php/404/index

    # Simple 404 for missing files
    <FilesMatch “(\.jpe?g|gif|png|bmp|css|js|flv)$”>
      ErrorDocument 404 “File Not Found”
    </FilesMatch>

    # Rewriting will likely already be on, uncomment if it isnt
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    </IfModule>

    # Block access to “hidden” directories whose names begin with a period. This
    # includes directories used by version control systems such as Subversion or Git.
    #<IfModule mod_rewrite.c>
    #  RewriteRule “(^|/)\.” - [F]
    #</IfModule>

    # remove the www - Uncomment to activate
    #<IfModule mod_rewrite.c>
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    #</IfModule>

    # Remove the trailing slash to paths without an extension
    # Uncomment to activate
    # <IfModule mod_rewrite.c>
    #  RewriteRule ^(.*)/$ /$1 [R=301,L]
    # </IfModule>


    <IfModule mod_rewrite.c>
    # Remove index.php
    # Uses the “include method”
    # http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
    RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/(site|global|cart|cart_examples|cart_multi_page_checkout|cart_includes|cart_ajax_examples|cart_functions|products|brand|battery-size|battery-type|account|blog|news|contact-us|Team|email_test|search_bad|other-products|xml_sitemaps|sitemap|customer|404|basket|clearance|downloads|search|links|about-us|help|exports|faqs|members|P[0-9]{2,8}) [NC]
    RewriteRule (.*) /index.php?/$1 [L]
    </IfModule>

    #—NSM .htaccess Generator End—

    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/watch-and-coin-cell-batteries/philips-silver-oxide-watch-377-sr66-battery-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-silver-oxide-watch-377-sr66-battery-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/12-volt-batteries/philips-special-alkaline-lr9-625a-12-volt-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-special-alkaline-lr9-625a-12-volt-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/12-volt-batteries/philips-special-alkaline-a76-lr44-12-volt-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-special-alkaline-a76-lr44-12-volt-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/12-volt-batteries/philips-special-alkaline-a23-lr-volt08-12-volt-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-special-alkaline-a23-lr-volt08-12-volt-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aa-batteries/philips-rechargeable-aa-2450-mah-b2-2xd-adapters-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-rechargeable-aa-2450-mah-b2-2xd-adapters-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aa-batteries/philips-battery-charger-world-travel-3.5hr-inc-2aa-2300mah-b1/” “http://www.houseofbatteries.co.uk//products/philips-battery-charger-world-travel-3.5hr-inc-2aa-2300mah-b1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aa-batteries/philips-rechargeable-aa-2450-mah-b2-2xc-adapters-pack-of-1/” “http://www.houseofbatteries.co.uk//products/philips-rechargeable-aa-2450-mah-b2-2xc-adapters-pack-of-1/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aaa-batteries/philips-rechargeable-ready-to-use-aaa-800-mah-batteries-pack-of-4/” “http://www.houseofbatteries.co.uk//products/philips-rechargeable-ready-to-use-aaa-800-mah-batteries-pack-of-4/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aaa-batteries/philips-rechargeable-aaa-700-mah-batteries-pack-of-4/” “http://www.houseofbatteries.co.uk//products/philips-rechargeable-aaa-700-mah-batteries-pack-of-4/”
    Redirect 301 “http://www.houseofbatteries.co.uk//battery-size/aaa-batteries/philips-rechargeable-aaa-1000-mah-batteries-pack-of-4/” “http://www.houseofbatteries.co.uk//products/philips-rechargeable-aaa-1000-mah-batteries-pack-of-4/”

     

  • #5 / Aug 27, 2012 12:50pm

    Shane Eckert

    7174 posts

    Hello ianryde,

    For testing, can you move that htaccess aside? The only htaccess file I can really work with is the supported version which I will paste in below.

    If you need to use those redirects, please let me know and I can move this over to the Community Help Forum forum.

    htaccess files are a bit out of my expertise! You get geek points for knowing as much as you do about htacess files. 😊

    Thank you,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases