Miva Merchant and WordPress .htaccess conflict

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rterrible
    Mivite

    • Jul 2006
    • 101

    #16
    Re: Miva Merchant and WordPress .htaccess conflict

    I'm having pretty much the same problem. I used the SEO Blogger to WordPress plug-in to move all of my old Blogger posts into my new WordPress Blog.
    All my Blogger posts are now there:

    but when I try to click a link to a month or an older post it leaves the /blog subfolder out and I just get an error:

    Same with my google SEO links - they redirect but leave out the /blog in the url:

    If you insert the /blog, the link is correct:


    I tried adding this to my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    </IfModule>
    # END WordPress

    but that didn't seem to work either. I tried different permalink settings as well but so far nothing has worked.
    Any suggestions?
    Thanks!
    rob
    www.personalizedboutique.com

    Comment

    • ILoveHostasaurus
      Mega Mivite










      • Mar 2006
      • 4998

      #17
      Re: Miva Merchant and WordPress .htaccess conflict

      If your store is using links of the format /<whatever>.html for product or category pages, then that's where you run into the conflict with wordpress which will also try to rewrite /<everything> to its index.php. So you've updated the blog which is the first step, but if that module in wordpress is still generating links of the format /?whatever then that's the first issue; it must be broken because if you've set the permalinks to always prefix /blog/ on the front then it's ignoring that.

      Next up, your .htaccess. I'd take this:

      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /blog/
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /blog/index.php [L]
      </IfModule>
      # END WordPress

      and make it:

      DirectoryIndex index.php
      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . index.php [L]
      </IfModule>
      # END WordPress

      and actually move that code into the blog directory and out of the main .htaccess file. That just makes things less complicated. Then in your primary .htaccess file, use:

      RewriteEngine On
      RewriteCond %{QUERY_STRING} ^m= [NC,OR]
      RewriteCond %{QUERY_STRING} ^p= [NC]
      RewriteRule ^(.*)$ http://www.personalizedboutique.com/blog/ [R=301,QSA,L]

      You'll have to test that, if it doesn't work I can give you an alternative. The 'QSA' portion *should* accomplish adding the original query string back on to the redirected URL.
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment

      • rterrible
        Mivite

        • Jul 2006
        • 101

        #18
        Re: Miva Merchant and WordPress .htaccess conflict

        Wow, thanks for the quick answer David. Yes, when I try using a /blog/ permalink it doesn't work - I just get a 'page not found' error.
        I will try playing around with the .htaccess code you suggested and see if that works.

        Thanks again
        rob
        www.personalizedboutique.com

        Comment

        • rterrible
          Mivite

          • Jul 2006
          • 101

          #19
          Re: Miva Merchant and WordPress .htaccess conflict

          Brian from Miva seems to have gotten it all sorted out. Turns out all that was needed was to go into Wordpress and under 'General Settings' change: "Site Address (URL): http://personalizedboutique.com" to "Site Address (URL): http://personalizedboutique.com/blog".
          Now all of the internal blog links are working correctly and the Blogger redirects from Google searches all seem to be working correctly as well :-)
          Thanks again for the input!
          rob
          www.personalizedboutique.com

          Comment

          • mdurkee
            Mivite

            • Mar 2011
            • 151

            #20
            Re: Miva Merchant and WordPress .htaccess conflict

            Leslie, Did that solution work for you?
            I have installed a WordPress blog in a sub-directory of my eCommerce site and really want it to stand separately without affecting my main site at all. I got all my pages, posts and the database moved over correctly but when I go to the site, it just re-directs back to my root home page - SFNT.
            My main site is www.heavytshirt.com and I want the blog to be in www.heavytshirt.com/blog but when you go to the blog directory it refuses to show the home page.
            I am really nervous about messing around with the .htaccess file.
            The line in my root .htaccess file looks more like this -

            Code:
            [COLOR=#2B91AF]DirectoryIndex[/COLOR] /mm5/merchant.mvc?[COLOR=#2B91AF]Screen[/COLOR]=SFNT
            would I just change it to:
            Code:
            [COLOR=#2B91AF][FONT=Consolas]
            DirectoryIndex[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]/[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]mm5[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]/[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]merchant[/FONT][/COLOR][COLOR=#000000][FONT=Consolas].[/FONT][/COLOR][COLOR=#000000][FONT=Consolas]mvc[/FONT][/COLOR]


            The .htaccess file in the blog directory looks like this:

            RewriteEngine on
            RewriteBase/

            # BEGIN WordPress
            <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteBase /blog/
            RewriteRule ^index\.php$ -[L]
            RewriteCond %{REQUEST_FILENAME}!-f
            RewriteCond %{REQUEST_FILENAME}!-d
            RewriteRule ./blog/index.php [L]
            </IfModule>
            # END WordPress


            Thanks,
            Maxanne
            Maxanne Durkee
            Heavyweight Collections - Premium Heavy T-Shirts
            Facebook, Twitter, Blog

            Comment

            Working...
            X