Skip to content
  • There are no suggestions because the search field is empty.

How to Move the Home Page to the Root Directory

Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.




Introduction

Many times while developing a site, it may be desirable to move the homepage of a ProductCart store to the root so that your "home.asp" file can serve as the homepage for the entire site. It is possible to use redirects with a Web.Config or .htaccess file to point to the "/store/pc/home.asp" file, for example, but it also is useful to be able to effectively migrate the ProductCart homepage to the root of your site, as you will learn below.
 

Not neccessary

Moving the home page to the root of your store is not neccessary. You can safely and effectively redirect visitors to your store's home page in a search engine friendly manner. Being two levels down from the root of the domain is  simply not considered a relevant ranking factor.
 

301 Permanent Redirect

The correct, search engine friendly way to redirect visitors (including search engine robots) to your ProductCart-powered home page is to place an index page in the root (typically a file named “default.asp”) that contains the following code (change productcart to match your folder structure):
<%
Response.Status = "301 Moved Permanently" 
Response.AddHeader "Location", "store/pc/home.asp"
Response.End
%>

Here is a default.asp file you can use for this purpose. Again, remember to change the path to "home.asp" as you might have renamed the store folder on your Web server.

Getting Started

This guide will give step-by-step instructions on how to successfully update the paths in all the necessary files in order for it to work when referenced from the root. Please make sure you follow these instructions carefully. Please also note that ProductCart does not provide technical support on implementing these code changes.

Assumptions

All the instructions below assume that...
  • Your store is running ProductCart v5.0 or higher. These instructions to not work on stores before v5.x versions of ProductCart.
  • ​Your store is located in the “root” of your Web site. That is, the “pc” folder is 2 levels down from the root.
  • Your store's folder name is “store”. This is the default folder name for the folder that contains all ProductCart files. This folder is typically renamed by ProductCart customers (e.g. “shop”, “order”, etc.). Adjust the instructions below accordingly, based on the name you used for that folder in your ProductCart installation.

Needed Files

In order to get started with moving your homepage to the root you'll need to start by copying the necessary files to the root of your site.
  • store/pc/header_wrapper.asp
  • store/pc/footer_wrapper.asp
  • store/pc/home.asp
  • store/pc/HomeCode.asp
You will then need to open each file in your favorite text or HTML editor to update the paths.


header_wrapper.asp
 

  • Locate the following include: 
    <!--#include file="inc_headerV5.asp" -->
    
  • Replace with: 
    <!--#include file="store/pc/inc_headerV5.asp" -->
    
  • ​​Locate the following Server.Execute calls:
    ​server.Execute(pcv_theme & "/header_facebook.asp")
    server.Execute(pcv_theme & "/header_mobile.asp")
    server.Execute(pcv_theme & "/header.asp")​​
    
  • Replace with:
    ​server.Execute("store/pc/" & pcv_theme & "/footer_facebook.asp")
    server.Execute("store/pc/" & pcv_theme & "/header_mobile.asp")
    server.Execute("store/pc/" & pcv_theme & "/header.asp")
    ​


footer_wrapper.asp
 

  • Locate the following include: 
    <!--#include file="inc_footer.asp" -->
    
  • Replace with: 
    <!--#include file="store/pc/inc_footer.asp" -->
    
  • ​​Locate the following Server.Execute calls:
    ​server.Execute(pcv_theme & "/footer_facebook.asp")
    server.Execute(pcv_theme & "/footer_mobile.asp")
    server.Execute(pcv_theme & "/footer.asp")​​
    
  • Replace with:
    ​server.Execute("store/pc/" & pcv_theme & "/footer_facebook.asp")
    server.Execute("store/pc/" & pcv_theme & "/footer_mobile.asp")
    server.Execute("store/pc/" & pcv_theme & "/footer.asp")

home.asp

 

  • ​Locate the following include statements:

    <!--#include file="../includes/common.asp" -->
    <!--#include file="../includes/common_checkout.asp" -->

    <!--#include file="../includes/CashbackConstants.asp" -->
    <!--#include file="prv_incFunctions.asp" -->​
    <!--#include file="pcStartSession.asp" -->​​
    <!--#include file="prv_getSettings.asp" -->​​​
    <!--#include file="pcValidateHeader.asp" -->​​​
    <!--#include file="pcValidateQty.asp" -->​​​
    <!--#include file="../includes/javascripts/pcValidateFormViewPrd.asp" -->​​​
    <!--#include file="pcShowProducts.asp" -->​​​​
    <!--#include file="atc_viewprd.asp" -->​​​​
    <!--#include file="orderCompleteTracking.asp" -->​​​​
    <!--#include file="inc-Cashback.asp" -->​​​​
     
  • Replace with:

    <!--#include file="store/includes/common.asp" -->
    <!--#include file="store/includes​/common_checkout.asp" -->

    <!--#include file="store/includes/CashbackConstants.asp" -->
    <!--#include file="store/pc/prv_incFunctions.asp" -->​
    <!--#include file="store/pc/pcStartSession.asp" -->​​
    <!--#include file="store/pc/prv_getSettings.asp" -->​​​
    <!--#include file="store/pc/pcValidateHeader.asp" -->​​​
    <!--#include file="store/pc/pcValidateQty.asp" -->​​​
    <!--#include file="store/includes/javascripts/pcValidateFormViewPrd.asp" -->​​​
    <!--#include file="store/pc/pcShowProducts.asp" -->​​​​
    <!--#include file="store/pc/atc_viewprd.asp" -->​​​​
    <!--#include file="store/pc/orderCompleteTracking.asp" -->​​​​
    <!--#include file="store/pc/inc-Cashback.asp" -->​​​​
  • ​You don't need to change the paths on header_wrapper.asp, footer_wrapper.asp, and HomeCode.asp since they are already in the root directory.

HomeCode.asp

  • ​Locate the following include statements:

    <!--#include file="pcCheckPricingCats.asp" -->
    <!--#include file="pcGetPrdPrices.asp" -->

    <!--#include file="pcShowProductP.asp" -->

  • Replace with:

    <!--#include file="store/pc/pcCheckPricingCats.asp" -->
    <!--#include file="
    store/pc/pcGetPrdPrices.asp" -->
    <!--#include file="store/pc/pcShowProductP.asp" -->