Forum Moderators: phranque
[edited by: phranque at 11:54 pm (utc) on Aug 17, 2017]
[edit reason] [webmasterworld.com...] [/edit]
Redirect 301 /speciality-tea.html https://www.example.co.uk/collections/all
Redirect 301 /ginseng-ginger-lime-tea.html https://www.example.co.uk/collections/all
...
http://www.example.com/speciality-tea/
http://www.example.com/product/ginseng-ginger-lime-tea/
RewriteEngine on
I've actually tried with and without .html and neither of them are correctly redirecting.
I am certain that I need Redirect 301 in order to redirect the individual pages from the old site to the new site.
If RewriteEngine isn't the correct option, I appreciate a point in the right direction if you wouldn't mind?
Have you verified that REWRITE is activated?
only the homepage redirect is currently working.
[edited by: phranque at 10:22 am (utc) on Aug 18, 2017]
[edit reason] Please Use Example.com [webmasterworld.com] [/edit]
However, only the homepage redirect is currently working. These are the URLs I'm trying to redirect to the above URLS that are not working:
http://www.example.com/speciality-tea/
...
http://www.example.com/tea-ceremony/
Redirect 301 /speciality-tea https://www.example.co.uk/collections/all
...
Redirect 301 /tea-ceremony https://www.example.co.uk/blogs/news
any request beginning with URL-path will return a redirect request to the client at the location of the target URL. Additional path information beyond the matched URL-path will be appended to the target URL.
http://www.example.com/product/ginseng-ginger-lime-tea/
http://www.example.com/product/earl-grey-tea/
Redirect 301 /ginseng-ginger-lime-tea https://www.example.co.uk/collections/all
Redirect 301 /earl-grey-tea https://www.example.co.uk/collections/all
With regards to your second point, I have ommitted some code from the .htaccess file but I don't think it impacts on this in any way. It was there preexisting before the site migration and permanent redirects. I believe it was set up to redirect links internally. This is it:
# BEGIN WordPress
The use of RewriteRule to perform this task may be appropriate if there are other RewriteRule directives in the same scope. This is because, when there are Redirect and RewriteRule directives in the same scope, the RewriteRule directives will run first, regardless of the order of appearance in the configuration file.
Redirect 301 / https://www.example.co.uk/
Redirect 301 /speciality-tea.html https://www.example.co.uk/collections/all
Redirect 301 /ginseng-ginger-lime-tea.html https://www.example.co.uk/collections/all
Redirect 301 /earl-grey-tea.html https://www.example.co.uk/collections/all
Redirect 301 /tea-ceremony.html https://www.example.co.uk/blogs/news
RewriteRule ^(index\.html)?$ https://www.example.co.uk/ [R=301,L]
RewriteRule ^(speciality|ginseng-ginger-lime|earl-grey)-tea\.html https://www.example.co.uk/collections/all [R=301,L]
RewriteRule ^tea-ceremony\.html https://www.example.co.uk/blogs/news [R=301,L]
RewriteRule ^(speciality|ginseng-ginger-lime|earl-grey)-tea\.html https://www.example.co.uk/collections/all#$1 [R=301,L,NE]
But only if that's really what you are doing.
[edited by: not2easy at 5:41 pm (utc) on Aug 21, 2017]
[edit reason] Please use 'example.co' in place of your domain name [/edit]
The requested URL /tea-ceremony/ was not found on this server.
This is the snippet I have in place to redirect that URL:
RewriteRule "^tea-ceremony\.html$" "https://www.example.co.uk/blogs/news/" [R=301,L]
I tried with a trailing slash, without a trailing slash, with and without a .html suffix but getting the same result.
The new site is on Shopify though so not sure if the fact the new site is on a different CMS changes anything.
is any of the site using WP?
where is the internal rewrite to the Shopify script?
RewriteRule ^(speciality|ginseng-ginger-lime|earl-grey)-tea\.html https://www.example.co.uk/collections/all [R=301,L]
RewriteRule ^(speciality-tea|ginseng-ginger-lime-tea|earl-grey-tea)\.html https://www.example.co.uk/product/$1 [R=301,L]
RewriteRule ^(speciality|ginseng-ginger-lime|earl-grey)-tea\.html https://www.example.co.uk/product/$1-tea [R=301,L]