using 301 redirect via htaccess on wp sites?

Discussion in 'WordPress' started by emmaburge, May 4, 2011.

  1. #1
    Hi all, im currently reading an ebook i bought recently about developing for wordpress (from the beginning) and it says, referring to 301 redirects within the .htaccess file:

    this part:

    “It was just a simple .htaccess
    redirect of the wp-config.php
    file (only for use on NON
    WordPress sites).”

    Basically saying you shouldnt use 301 redirect in .htaccess on any wp core files or folders.

    i read on a comment thread though:

    “PHP loads the file (any include for that matter) locally, right from the file system. Apache has nothing to do with that. It’s no problem to use this even if you do run WordPress.”

    so is it ok to use this 301 or any 301 redirect within htaccess?
     
    emmaburge, May 4, 2011 IP
  2. bekar09

    bekar09 Active Member

    Messages:
    283
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #2
    As far as I know it is fine. What would you do if you moved your site to a new domain? you have to use .htaccess in that situation.
     
    bekar09, May 4, 2011 IP
  3. samie

    samie Member

    Messages:
    269
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #3
    I don't see how there's any problem with using 301 redirects in .htaccess with Wordpress sites. I do it all the time. However, if you're doing a 301 redirect to redirect non-www to www, you need to make sure that your WP_option's table is set to the same URL as the redirect is going to. Otherwise, it will most likely cause your site to break.
     
    samie, May 4, 2011 IP