Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

how to 404 redirect from old root

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-30-2006, 07:47 PM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default how to 404 redirect from old root

we moved our site from www.corecases.com/store to the root - that's working fine, but apparently there are several links out there that still point to www.corecases.com/store/home.php

what is the best way to have any link that links to our /stoire folder to redirect to our current home page at www.corecases.com?

am i right in thinking this could be addressed in our .htaccess file?

should we have completely deleted the /store folder?

i do have the DSEFU mod installed

i looked for a while but did not see this specific topic addressed, so sorry if i missed it somewhere.

TIA
__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
  #2  
Old 03-30-2006, 09:59 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

put an htaccess in /store directory

Code:
Redirect /store/ http://yoursite.com/
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #3  
Old 03-30-2006, 10:13 PM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default

ok, beautiful, that takes care of anyone going to store/home.php - thanks lionel -

is that one of those permanent redirects that won't harm SEO rankings, right?

OK, next problem:

since moving to the new store, i noticed that if someone clicks on an old search engine link (with the php url, like the one below), they get an error id=33 message - is there any way to just redirect them to the home page if they click on an expired/invalid link?

i have totally redone my products with new productids and catids, so these items/categories do not exist anymore.

thanks!

Google search link:

Code:
5g 60gb iPod Core Green :: 5G iPod 60gb :: 5G iPod Core Cases ... Cases and accessories for iPod,PSP,Handheld gaming devices,iPod skins,Custom cases,iPod accessories,Nano,Shuffle,iPod mini. www.corecases.com/product.php?productid=16299&cat=492&page=1 - 49k - Cached - Similar pages
__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
  #4  
Old 03-30-2006, 10:29 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

This has nothing to do with SEO

for broken links, if you do not want to display errors, put in the error documents in your htaccess. It's more elegant anyway

Code:
ErrorDocument 401 http://site.com/page.htm ErrorDocument 403 http://site.com/page.htm ErrorDocument 404 http://site.com/page.htm ErrorDocument 500 http://site.com/page.htm ErrorDocument 503 http://site.com/page.htm

and create the static pages, putting whatever you want in there. Me i put images of the categories. You can also put a sitemap.php instead of page.htm if you have that mod installed. Do a search on the net to see what those errors are and to create pages with proper wordings.

Now for that error 33 it's a little more involved although simple. Go into include/func.php and just change that line in func.php to what you want, replacing the error_message.php?access_denied&id=33 with

Quote:
home.php

Code:
# Error handling # if (!$product || !$categoryid) { if ($redirect_if_error) func_header_location("error_message.php?access_denied&id=33"); else return false; }
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #5  
Old 03-30-2006, 11:12 PM
  thundernugs's Avatar 
thundernugs thundernugs is offline
 

Senior Member
  
Join Date: May 2003
Location: Bend, OR
Posts: 117
 

Default

lionel, the func.php mod worked great, you are the man!

i'll have to put in a litle more time on the custom redirects, but i agree, it's a much more elegant way to get the site visitor back on track.

thanks!

mike
__________________
X-Cart Gold 4.0.17 & 4.0.18
Linux Server
Hands-On Hosting
http://www.CoreCases.com - Ipod Cases
http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need
Reply With Quote
  #6  
Old 03-31-2006, 12:28 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Your original post is similair to a question i was wanting to ask.

Because we will be rebranding our site and with a different domain name. I'm wondering if its possible to do a blanket 301 redirect

so that for example

http://www.justhom.com/product.php?productid=366&cat=0&page=1

can become

http://www.xyz.com/product.php?productid=366&cat=0&page=1<br /> <br /> with one line of code in .htacces... and variable.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #7  
Old 03-31-2006, 10:31 AM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

Default

Quote:
Originally Posted by cotc2001
Your original post is similair to a question i was wanting to ask.

Because we will be rebranding our site and with a different domain name. I'm wondering if its possible to do a blanket 301 redirect

so that for example

http://www.justhom.com/product.php?productid=366&cat=0&page=1

can become

http://www.xyz.com/product.php?productid=366&cat=0&page=1<br /> <br /> with one line of code in .htacces... and variable.

I moved my site to the root and had the following line in my .htaccess file that redirected all my links that were out on the search engines to the proper page on the root. Essentially, it just removed the /xcart part from the link. www.mysite.com/xcart/product.php?productid=366&cat=0&page=1 was redirected to www.mysite.com/product.php?productid=366&cat=0&page=1. The .htaccess code for this redirect was as follows:
Code:
Redirect 301 /xcart http://www.mysite.com
You should be able to accomplish what you want by simply putting the following redirect in your .htaccess file for your old site.
Code:
Redirect 301 http://www.newsite.com
I believe it would work the same way and that all your links to your old site would be redirected to the proper page on your new site. Give it a shot and let me know if it works.
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:15 AM.

   

 
X-Cart forums © 2001-2020