ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Search Engine Optimization
  New Posts New Posts RSS Feed - Rewrite away PC's sub-directories
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Rewrite away PC's sub-directories

 Post Reply Post Reply Page  <123
Author
Message
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 05-June-2010 at 1:17am
I ran into another JavaScript issue today. The issue was with PCa SP4 when a sub-product was set to change the price if this option were selected when using the drop-down select option for display. On the client side, any of the options set this way would not appear.

For example:

Color: Blue | Red
Size: Small | Large (+1.00)

In this scenario, "Large (+$1.00)" will not show in either color.

I've updated the rules and conditions posted on the first post of this thread.

Edited by Sean@WMS - 05-June-2010 at 1:18am
Back to Top
blackey View Drop Down
Newbie
Newbie


Joined: 11-November-2008
Location: Livermore, CA
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote blackey Quote  Post ReplyReply Direct Link To This Post Posted: 06-June-2010 at 1:19pm
Sean,

Have you noticed multiple Custom search fields not working.  I can do one, but when I add a second it crashes.  Works fine with the rewrite off.

Bill

Back to Top
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Posted: 06-June-2010 at 5:35pm
# Permanently redirect all pages that were using sub-directories:
RewriteRule ^store/pc/(.*)$ $1 [NE,NC,R=301,L]


If you add NE to that line, it should work.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 23-September-2010 at 6:06pm
Ok, v4.1 introduced a new thing to deal with here. In several places there are calls to JavaScripts and such:


<link type="text/css" rel="stylesheet" href="../pc/ei-tooltip.css">

<script language="javascript" type="text/javascript" src="../pc/ei-tooltip.js"></script>

<script type="text/javascript" src="../pc/XHConn.js"></script>


This causes a problem with the ISAPI_Rewrite script I've been using, as the page is already in the /pc/ folder but src looks up the the /productcart/ folder and then back down to the /pc/ folder again. This is a problem when we've rewritten away the /productcart/ and /pc/ folders. I've added this to the origin post here.


# Handle objects called via ../pc/ when already in the /pc/ folder:
RewriteRule ^pc/(.*)$ productcart/pc/$1 [NC,L]


Edited by Sean@WMS - 23-September-2010 at 7:50pm
Back to Top
ProductCart View Drop Down
Admin Group
Admin Group

ProductCart Team

Joined: 01-October-2003
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote ProductCart Quote  Post ReplyReply Direct Link To This Post Posted: 23-September-2010 at 7:28pm
Originally posted by Sean@WMS Sean@WMS wrote:

Why when the page is already in the /pc/ folder the src looks up the the /productcart/ folder and then back down to the /pc/ folder where you are already are is beyond me...


The reason is that the same code is used in the Control Panel as well. For example, when you add a product to an order via the Edit Order feature, you are using a lot of code that is included into the Control Panel files, but actually resides in the pc folder. This is done to avoid code duplication (the product details page alone, for example, means a lot of code that would have to be duplicated).


Edited by earlyimp - 23-September-2010 at 7:29pm
The ProductCart Team

Home of ProductCart shopping cart software
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 23-September-2010 at 7:48pm
Originally posted by earlyimp earlyimp wrote:



Originally posted by Sean@WMS Sean@WMS wrote:

Why when the page is already in the /pc/ folder the src looks up the the /productcart/ folder and then back down to the /pc/ folder where you are already are is beyond me...
The reason is that the same code is used in the Control Panel as well. For example, when you add a product to an order via the Edit Order feature, you are using a lot of code that is included into the Control Panel files, but actually resides in the pc folder. This is done to avoid code duplication (the product details page alone, for example, means a lot of code that would have to be duplicated).


AH! I see, said the blind man as he picked his hammer and saw. Now that makes sense. I was scratching my head on that one.
Back to Top
Guests View Drop Down
Guest
Guest
Post Options Post Options   Thanks (0) Thanks(0)   Quote Guests Quote  Post ReplyReply Direct Link To This Post Posted: 08-November-2012 at 4:03pm
Thought I should add on to this the method for doing this in IIS 7 with the URL Rewrite extension installed.

First of all, the URL Rewrite extension must be installed in IIS. Download it here:

The rules can then be added to the <system.webServer> section:
<rewrite>
    <rules>
        <clear />
        <rule name="Imported Rule 18" stopProcessing="true">
            <match url="^(images/.*|catalog/.*|custom/.*|Library/.*|tax/.*)$" />
            <action type="Rewrite" url="productcart/pc/{R:1}" />
        </rule>
        <rule name="Imported Rule 19" stopProcessing="true">
            <match url="^(UPSLicense/.*|CAPTCHA/.*)$" />
            <action type="Rewrite" url="productcart/{R:1}" />
        </rule>
        <rule name="Imported Rule 20" stopProcessing="true">
            <match url="^(includes/.*)$" />
            <action type="Rewrite" url="productcart/{R:1}" />
        </rule>
        <rule name="Imported Rule 21" stopProcessing="true">
            <match url="^productcart/pc/(.*)$" />
            <action type="Redirect" url="{R:1}" redirectType="Permanent" />
        </rule>
        <rule name="Imported Rule 22" stopProcessing="true">
            <match url="^([^/]+)$" />
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="productcart/pc/{R:1}" />
        </rule>
        <rule name="Imported Rule 23" stopProcessing="true">
            <match url="^pc/(.*)$" />
            <action type="Rewrite" url="productcart/pc/{R:1}" />
        </rule>
</rules>
</rewrite>
Back to Top
 Post Reply Post Reply Page  <123
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.