X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   how to 404 redirect from old root (https://forum.x-cart.com/showthread.php?t=20842)

thundernugs 03-30-2006 07:47 PM

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

Lionel 03-30-2006 09:59 PM

put an htaccess in /store directory

Code:

Redirect /store/ http://yoursite.com/

thundernugs 03-30-2006 10:13 PM

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

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


Lionel 03-30-2006 10:29 PM

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;
        }


thundernugs 03-30-2006 11:12 PM

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

cotc2001 03-31-2006 12:28 AM

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.

TJ Stephens 03-31-2006 10:31 AM

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.


All times are GMT -8. The time now is 02:12 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.