Post by acjp » Wed Dec 12, 2018 8:14 am

hi,
i try to make redirect 301 but i can't find a right setting.
it is my .htacces:

Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteCond %{HTTP_HOST} ^(www\.)?sample.com$
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.sample.com/%{REQUEST_URI} [NC,L,R]

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteRule ^it/oldcategory1/oldcategory2/product$ https://www.sample.com/it/newcategory1/ ... y2/product [L,R=301]

is it correct?

thanks a lot

Newbie

Posts

Joined
Thu Sep 27, 2018 9:47 pm

Post by IP_CAM » Wed Dec 12, 2018 11:53 am

Well, your Link shows a Subdirectory:
https://www.sample.com/it/...
but your Rewrite Base is empty:
RewriteBase /
And that does not match! :(
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by acjp » Wed Dec 12, 2018 5:20 pm

Thank you for your answer.
sorry but I'm not expert, could you tell me more?
I've tried both
RewriteBase / it /
but it generates 500 and both with
RewriteRule ^ oldcategory1 / oldcategory2 / product $ https://www.sample.com/newcategory1/ ... y2 / product [L, R = 301]
and it does not work anyway.

Newbie

Posts

Joined
Thu Sep 27, 2018 9:47 pm

Post by paulfeakins » Wed Dec 12, 2018 6:34 pm

RewriteBase /{why are you putting a space here?}it{and here?}/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by acjp » Wed Dec 12, 2018 8:49 pm

tanks for answer. i didn't put space. it is for copy and paste. with this setting i have a 500 error.

Newbie

Posts

Joined
Thu Sep 27, 2018 9:47 pm

Post by acjp » Thu Dec 13, 2018 5:15 pm

nobody can help me?

Newbie

Posts

Joined
Thu Sep 27, 2018 9:47 pm

Post by IP_CAM » Thu Dec 13, 2018 5:35 pm

Well, as long as you're affraid to display your REAL Shop Site URL,
here is no help !
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by acjp » Thu Dec 13, 2018 8:19 pm

I'm sorry, I didn't think it was relevant and I've always seen it done in the forum.
here is the data of the site:

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

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

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteCond %{HTTP_HOST} ^(www\.)?salumipasini.com$
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.salumipasini.com%{REQUEST_URI} [NC,L,R]

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

RewriteRule ^it/confezioni-speciali/tutta-la-tradizione/trezzano-sul-naviglio$ https://www.salumipasini.com/it/tutti-i ... l-naviglio [L, R = 301]

Newbie

Posts

Joined
Thu Sep 27, 2018 9:47 pm

Post by paulfeakins » Thu Dec 13, 2018 8:45 pm

Maybe move that rule higher up in the file?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 390 guests