Announcement

Collapse
No announcement yet.

htacces and blog redirects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    htacces and blog redirects

    I have a blog that is in a subfolder of my current store domain. I was told that best practice was to create a Wordpress blog in its own blog subdomain and then do 301 redirects when I move pages to the new Wordpress blog. I am moving one page at a time and then creating the redirect, but... I can't seem to get it to work.

    Here is the link structure:
    Old page: www.storedomain.com/blog/blogfolder/oldpage.htm
    New page: blog.storedomain.com/newpage/

    This is what I tried:
    I added the following to an htaccess file within the original "blog" subfolder on our domain.
    Redirect 301 /blogfolder/oldpage.htm http://blog.storedomain.com/newpage/

    Is there something I'm missing in this redirect from domain subfolder to a new subdomain?

    Thanks,
    Shannon

    #2
    Definitely agree on the best practice being separation. The issue is that the way Miva Merchant's URI management, and Wordpress' permalinks, work, is effectively the same and at conflict with one another. They both have the expectation of using rewrites to send all requests for non-existent content to a handler, which then allows the application to decide how to handle the request. So if they're on the same site/domain, and you want to use URI management and permalinks, one of the two is going to need a prefix to all the requests so the rewrites can be altered to send requests to the appropriate application.

    Anyway, that being said, the issue in your case may be the redirects occurring in your .htaccess file after your rewrite rules. So, if your htaccess looks something like this:

    Code:
    ### Begin - Miva Merchant URI Management: Direct all non-file URIs to Miva Merchant
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteCond %{REQUEST_URI} !^/mm5/.*$
    RewriteRule ^(.*)$ /mm5/uri.mvc? [QSA,L]
    ### End - Miva Merchant URI Management
    
    Redirect 301 /blog/blogfolder/oldpage.htm http://blog.storedomain.com/newpage/
    Try moving the Redirect lines up above the rewrite stuff. If they occur after, the rewrite would get run first, sending your request to the store, and the redirect never seen. We may also need to alter the rewrites but wanted to check this scenario first. Also, your example mentions old page as being /blog/blogfolder/oldpage.htm but your redirect leaves the /blog off the front; I wanted to make sure that was just a typo and not what was in the htaccess since it doesn't match.
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Okay that's the direction I was thinking next. I left the /blog off because I put an htaccess redirect inside the /blog/ folder. But I will try adding to the redirect above the Rewrites in my main htaccess file.

      Comment


        #4
        I put the redirect rule above everything else in my main htaccess file, and it worked. At first I didn't think it was working but it was a cache issue. Thanks!
        Last edited by srmb; 06-21-17, 09:31 AM.

        Comment

        Working...
        X