Apologies if this is in the wrong forum. (Mods, please feel free to move if it is)
I have multi-store running on v1.5.1 and am about to add one of my main stores as an add-on domain but I've realised that unless I match the new url's to the old google listed url's I will lose the listing in google. (Not good!)
So my question is: Is there any way to redirect a sub-store using a 301 redirect when I'm using an add-on domain?
Just to clarify my set up, I have:
DomainA (Main cpanel account)
DomainB (Add-on domain from DomainA cpanel)
I want the old google links pointing to domainB url's to redirect to DomainB new url's.
I tried using:
redirect 301 /old-google-url-p-109.html http://domainB/new-OC-url.html
As the htaccess is in the root of DomainA this doesnt work.
Any ideas if this can be done? (I can export my products and make the new url's match the old url's but this will take forever with thousands of products and the old zen url's are horrible!) a 301 will definitely be the easiest option if possible?
Hope that makes sense?
I have multi-store running on v1.5.1 and am about to add one of my main stores as an add-on domain but I've realised that unless I match the new url's to the old google listed url's I will lose the listing in google. (Not good!)
So my question is: Is there any way to redirect a sub-store using a 301 redirect when I'm using an add-on domain?
Just to clarify my set up, I have:
DomainA (Main cpanel account)
DomainB (Add-on domain from DomainA cpanel)
I want the old google links pointing to domainB url's to redirect to DomainB new url's.
I tried using:
redirect 301 /old-google-url-p-109.html http://domainB/new-OC-url.html
As the htaccess is in the root of DomainA this doesnt work.
Any ideas if this can be done? (I can export my products and make the new url's match the old url's but this will take forever with thousands of products and the old zen url's are horrible!) a 301 will definitely be the easiest option if possible?
Hope that makes sense?
Try putting the following in your .htaccess file:
and see if that works.
Code: Select all
Redirect permanent /old-google-url-p-109.html http://domainB/new-OC-url.html
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Hi Fido-x,
Thank you for the quick reply. I think you're onto something! It does now redirect to the correct site and url. Unfortunately it is appending the route to the url once redirected.
eg: http://www.DomainB.co.uk/New-Url?_route_=Old-URL
Is there anyway to get rid of the end part?
Thank you for the quick reply. I think you're onto something! It does now redirect to the correct site and url. Unfortunately it is appending the route to the url once redirected.
eg: http://www.DomainB.co.uk/New-Url?_route_=Old-URL
Is there anyway to get rid of the end part?
I thought so. It probably does make a difference, since you're getting "_route_" in the redirect. Does it work with SEO turned off?asphole wrote:Also have 'Use SEO URL's:' enabled if that makes any difference?
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
No, Just tried it without seo enabled and back to page not found with browser showing old url.
I changed htaccess to show new no seo enabled url ( /index.php?route=product/product&path=1_25&product_id=1042) and that didnt work either. grrrr!! I HATE things I dont understand!!
I changed htaccess to show new no seo enabled url ( /index.php?route=product/product&path=1_25&product_id=1042) and that didnt work either. grrrr!! I HATE things I dont understand!!
see -> http://forum.opencart.com/viewtopic.php?f=20&t=38821
The guy hasn't got back on that thread either but wont hurt to try I guess
The guy hasn't got back on that thread either but wont hurt to try I guess
uksitebuilder, You're a star mate!!! That worked a treat and is definitely going to save a lot of dropped links or rewriting urls to the old crappy zen ones!
I was concerned that I would lose all the listings for my main site and we have a lot of page 1 rankings so was very hesitant about moving it to oc but that has done the trick.
One more question I have is whether this could be duplicated in someway on a per domain basis?
ie:
redirect domainB old url to domainB new url
AND
redirect domainC old url to domainC new url
AND
redirect domainD old url to domainD new url
No problems if it cant be done as my main concern was DomainB but it would be nice not to lose any rankings on DomainC,D,E etc.
Anyway, whatever the outcome for last question, thanks so much for your help on resolving my original one!
I was concerned that I would lose all the listings for my main site and we have a lot of page 1 rankings so was very hesitant about moving it to oc but that has done the trick.
One more question I have is whether this could be duplicated in someway on a per domain basis?
ie:
redirect domainB old url to domainB new url
AND
redirect domainC old url to domainC new url
AND
redirect domainD old url to domainD new url
No problems if it cant be done as my main concern was DomainB but it would be nice not to lose any rankings on DomainC,D,E etc.
Anyway, whatever the outcome for last question, thanks so much for your help on resolving my original one!
Simon, You're a legend mate!! Absolutely spot on and works a treat on all domains!!
Just to recap the exact code I'm using for any others in the same position:
RewriteRule ^old-url.html$ http://%{HTTP_HOST}new-url.html? [R=301,L]
I seriously can't thank you enough mate. This was causing me a serious headache and I was getting worried I would lose some rankings on a few existing sites but this should certainly minimize any loss of position.
Thanks again, I really appreciate your patience and taking the time to help.
Cheers
Just to recap the exact code I'm using for any others in the same position:
RewriteRule ^old-url.html$ http://%{HTTP_HOST}new-url.html? [R=301,L]
I seriously can't thank you enough mate. This was causing me a serious headache and I was getting worried I would lose some rankings on a few existing sites but this should certainly minimize any loss of position.
Thanks again, I really appreciate your patience and taking the time to help.
Cheers
I've just noticed an odd issue with my url's and wonder if anyone can see the problem?
I am using the following code:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This appears to work for most links, however, some links (Login/Create Account/My Account/Checkout etc) show the following url: www.domain.co.uk/://index.php/seo-url
'://index.php/seo-url' added to end of rewritten url
The visitor still reaches the page they clicked on but the url is obv wrong.
With seo urls off the links look normal so I am guessing it is the htaccess.
Any ideas?
I am using the following code:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This appears to work for most links, however, some links (Login/Create Account/My Account/Checkout etc) show the following url: www.domain.co.uk/://index.php/seo-url
'://index.php/seo-url' added to end of rewritten url
The visitor still reaches the page they clicked on but the url is obv wrong.
With seo urls off the links look normal so I am guessing it is the htaccess.
Any ideas?
I just looked on a client's domain who uses multi-store and the same strange behaviour is evident there also, but only on the multi-store domain names, not the main domain name.
This is not a .htaccess problem, but rather a problem with how the links in the site are written.
.htaccess converts what is sent to the server (from a SEO URL to an original path - index.php?route=...)
I will investigate
This is not a .htaccess problem, but rather a problem with how the links in the site are written.
.htaccess converts what is sent to the server (from a SEO URL to an original path - index.php?route=...)
I will investigate
Who is online
Users browsing this forum: No registered users and 123 guests