Zen Cart Logo
Forums / Search Engines / moved store from root to folder - will inbound links be lost?

moved store from root to folder - will inbound links be lost?

Views: 56

Results 1 to 9 of 9
10 Jan 2014, 07:00
#1
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

moved store from root to folder - will inbound links be lost?

Hi - I moved my store from the root to a folder /store/ and then deleted the store from the root.

I am getting a bunch of 404's which I expect however it seems inbound links from other domains are broken; i.e. a link to domain.com/index.php?main_page=index&cPath=45 is now broken as that file no longer exists in the root.

I have tried creating a page in my CMS an calling it /index.php?main_page=index&cPath=45 however it will not accept the ? in the url, it replaces it with a - (space)

Is there a way I can re-direct the urls that have inbound links to the same url in /store - is there another way to overcome the ? issue in the url or do I simply load a copy of the store back into the root and redirect the appropriate pages? that would mean redirecting /index.php to index.html would it?

Too late now but I should have posed the question on how best to re-direct before doing what I did.

looking forward to some assistance,
cheers, Mike

10 Jan 2014, 07:14
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: moved store from root to folder - will inbound links be lost?

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ store [L]

10 Jan 2014, 07:19
#3
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: moved store from root to folder - will inbound links be lost?

RodG:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ store [L]

Thanks for the quick response Rod - I actually figured it out - I simply copied index.php from the store into the root and then did 301 redirect back to the store, now any file with index.php(any extension) now redirects to the same page in the store - works like a charm. I am building up the 'Home' page and other pages (articles etc) in the root for SEO purposes, hence moving the store to a folder.

Again many thanks,
Mike

10 Jan 2014, 07:34
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: moved store from root to folder - will inbound links be lost?

shags38:

Thanks for the quick response Rod - I actually figured it out - I simply copied index.php from the store into the root and then did 301 redirect back to the store, now any file with index.php(any extension) now redirects to the same page in the store - works like a charm. I am building up the 'Home' page and other pages (articles etc) in the root for SEO purposes, hence moving the store to a folder.

Again many thanks,
Mike

FWIW, a rewrite is generally a much better option than a redirect.
Please don't ask me to explain why because it'll probably invoke a 'religious war'.

Cheers
RodG

10 Jan 2014, 08:46
#5
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: moved store from root to folder - will inbound links be lost?

FWIW, a rewrite is generally a much better option than a redirect.
Please don't ask me to explain why because it'll probably invoke a 'religious war'.

Hi Rod,

The war is on in earnest :smile:

I am happy for you to give me a rewrite code for this redirect; Redirect 301 /index.php http://www.dazzlers.net.au/store/index.php

cheers, Mike

10 Jan 2014, 09:00
#6
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: moved store from root to folder - will inbound links be lost?

Rod - quick question, related but not closely - how can I change a category i.d., say from 75 to 14, category is empty, no products - not moving products, has to do with linking or re-directing links. I decided in the store not to have certain products, over 300 in a category so got lazy and deleted the category - then created the category again so as I could put a page saying 'hey please go to my other site for these products' but that category is i.d. 75, the original category was 14 so all inbound links are to path=14, I don't want to put a re-direct on a re-direct.

cheers, Mike

10 Jan 2014, 17:16
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: moved store from root to folder - will inbound links be lost?

Category ids are auto-incremented using the next available number, and there is no way in Zen Cart to alter this. You would have to go into your database directly with phpMyAdmin and alter that category id from 75 to 14. If you don't have any activity or products with this new category, it should be a simple edit, but you should make a full db backup first just in case.

10 Jan 2014, 17:20
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: moved store from root to folder - will inbound links be lost?

The "RewriteEngine" code that Rod gave you in post #2 is what you would put in your .htaccess file (I think in your domain root) to do the rewriting. For this, you would not have or want an index.php in the domain root - it would be irrelevant.

Now we can start the religious war about SEO if you like...
Is the search engines' convenience more important to your store's success than your customers' convenience in getting directly to your store and products on reaching your domain, versus having to go into a subfolder to actually buy something?

12 Jan 2014, 20:30
#9
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: moved store from root to folder - will inbound links be lost?

Hi Linda,

Category ids are auto-incremented using the next available number, and there is no way in Zen Cart to alter this. You would have to go into your database directly with phpMyAdmin and alter that category id from 75 to 14. If you don't have any activity or products with this new category, it should be a simple edit, but you should make a full db backup first just in case.

Thank you - worked a treat!

Now we can start the religious war about SEO if you like...
Is the search engines' convenience more important to your store's success than your customers' convenience in getting directly to your store and products on reaching your domain, versus having to go into a subfolder to actually buy something?

No need to convince me - I am in total agreement. I have 6 ZC sites - all have the store in the root (except now for this one) and all are ranking very nicely. This site in question has a very checkered history and as much as it is a PR2 it is not ranking anywhere in SERP's, likely due to Penguin and Panda (guilty) - the site has been cleaned up and I am desperately trying different things to raise its standing in SERP's, in this case creating a new landing page for the bots - probably all futile but every once in a while I try something to see if it works. I probably should leave it alone for 10 years or so till any algo penalties expire via natural death - or until Bing swallows Google (optimist??)

Many thanks for your responses - much appreciated.

cheers,
Mike