Page 1 of 1

301 redirects not working alongside sef URL's

Posted: Fri Sep 17, 2010 8:35 pm
by DaveBunny
Hi all, I have an issue with an OpenCart Redirect file, I am new to OpenCart and 301 redirects.

There are 2 kinds of redirect going on in the file, one is the part for the SEO friendly URLs but this site existed before and has transferred to OpenCart so the there are individual Google link redirects going on as well.

I managed to get the google redirects working by deleting the QSA from the last Redirect rule but this had other ramifications – the query strings for which page of products the user is on would then be ignored and they would be stuck on page 1.

Is there a way I can get the google links redirected to the appropriate pages and have the SEO friendly URLs on once they’re in the site.

Thank you, see below for a slightly butchered htaccess file :o)

Dave

P.s i've added a space in the url's below in case of the forum rules.

********************htaccess file begin*************************

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www. opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Redirect 301 /page/4534098781 http://www .uktrailerparts.co.uk/Load-Restraint-Equipment
Redirect 301 /page/4534098640 http://www. uktrailerparts.co.uk/Curtain-Tensioners
Redirect 301 /tir-cords/4534098782 http://www. uktrailerparts.co.uk/TIR-Cords-TIR-Cables-TIR-Tooling

RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

********************htaccess file end*************************

Re: 301 redirects not working alongside sef URL's

Posted: Fri Sep 17, 2010 9:51 pm
by JAY6390
Put your redirect rules ABOVE the RewriteEngine On