nopCommerce stopped working from subfolder after moving Wordpress to root

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
I have a web site with straight HTML pages at the root and nopCommerce installed in a subfolder called "shop" (i.e. www.mysite.com/ship)

We installed a WordPress site into a different subfolder where it was working properly (i.e. www.mysite.com/newsite)

After finishing the new Wordpress site, we moved it to the root folder using these instructions http://codex.wordpress.org/Moving_WordPress which pretty much just moves all the files, then runs a search and replace to change the paths.

Now, the nopCommerce site is still in the shop folder and the homepage will come up, but then anything you click results in a page with the Wordpress template and 404 Not Found.  It's as if Wordpress is taking over the requests even in the nop subfolder.

Is there a way to get them to live together nicely given that they are not in the same folder?  Or am i going to have to get a new domain and a new site to move the nopCommerce installation over to?
8 years ago
jvolzer wrote:
I have a web site with straight HTML pages at the root and nopCommerce installed in a subfolder called "shop" (i.e. www.mysite.com/ship)

We installed a WordPress site into a different subfolder where it was working properly (i.e. www.mysite.com/newsite)

After finishing the new Wordpress site, we moved it to the root folder using these instructions http://codex.wordpress.org/Moving_WordPress which pretty much just moves all the files, then runs a search and replace to change the paths.

Now, the nopCommerce site is still in the shop folder and the homepage will come up, but then anything you click results in a page with the Wordpress template and 404 Not Found.  It's as if Wordpress is taking over the requests even in the nop subfolder.

Is there a way to get them to live together nicely given that they are not in the same folder?  Or am i going to have to get a new domain and a new site to move the nopCommerce installation over to?


Hi,

Its definitely not an issue with nopCommerce or WordPress, but your site's re-direction rules (on LAMP it is managed by htaccess) but on Windows it should be redirection rules defined web config or somewhere else. Pls check docs for hosting wordpress on windows to figure out where you need to modify.

Regards,
Krunal
8 years ago
I'm hosting with Arvixe.  I don't see an htaccess file, but there is a web.config file.  Could this be where I need to look? I need WP to work from root and nop to work from the /shop folder where it's installed.
8 years ago
Here's my web.config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".svg"/>
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"/>
    </staticContent>
    <rewrite>
      <rules>
      <rule name="wordpress" patternSyntax="Wildcard">
        <match url="*"/>
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
          </conditions>
        <action type="Rewrite" url="index.php"/>
      </rule></rules>
    </rewrite>
  </system.webServer>
</configuration>
8 years ago
Can anyone help?
8 years ago
Anyone?
8 years ago
Your rewrite rule is rewriting everything to index.php.
Therefore the webserver cannot access the nopCommerce installation

You need to exclude your nopCommerce dir in the rewrite rule by adding the following:

<add input="{REQUEST_URI}" pattern="^/yourNopcommerceFolder" negate="true" />
8 years ago
Nopaholics wrote:
Your rewrite rule is rewriting everything to index.php.
Therefore the webserver cannot access the nopCommerce installation

You need to exclude your nopCommerce dir in the rewrite rule by adding the following:

<add input="{REQUEST_URI}" pattern="^/yourNopcommerceFolder" negate="true" />


Thanks for the suggestion.  I'm having a little trouble with this though.

First, where in the file should I place this.

Next, should I assume that the carat (^) to the left of the slash is a wildcard so that I don't need to put my domain name? That is, should my line read:

<add input="{REQUEST_URI}" pattern="^/shop" negate="true" />

Since my installation is in the shop folder under my domain.  By the way, my site is: http://surpasssoftware.com/shop

You'll notice that the main page comes up fine, but all links jump to the word press handler/theme, etc.
8 years ago
Your configuration should be as followed:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".svg"/>
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"/>
    </staticContent>
    <rewrite>
      <rules>
      <rule name="wordpress" patternSyntax="Wildcard">
        <match url="*"/>
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
      <add input="{REQUEST_URI}" pattern="^/shop" negate="true" />
          </conditions>
        <action type="Rewrite" url="index.php"/>
      </rule></rules>
    </rewrite>
  </system.webServer>
</configuration>

And indeed it's not required to add the domain name.
8 years ago
I created a web.config with the exact contents you provided, then restarted the app pool and the web server (via the Arvixe control panel, where this is hosted).  However, the results are the same.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.