WordPress.org

Ready to get started?Download WordPress

Forums

Has WordPress KILLED 301 Redirects??? (4 posts)

  1. shadowboxa
    Member
    Posted 1 year ago #

    I have operated hundreds of self hosted WordPress sites for years now and used the same .htaccess redirect format to direct users to a product that I own and sell.

    I'm not sure how long this has been happening, but every single one of them is now: "not found" or "nothing found" etc etc. This is the same for sites on many different web hosts and different versions of wordpress.

    The Code that was working fine for a long time is:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    Redirect 301 /go/myproduct http://www.myproduct.com
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    1. Any reason why this would suddenly stop working, on all sites, on different hosts?

    2. If there has been some kind of change, how long since it was implemented?

    Many thanks!!

    Ben

  2. 1. Any reason why this would suddenly stop working, on all sites, on different hosts?

    No idea but I've always found that syntax to be tricky. WordPress doesn't effect other items in .htaccess. Your host may have an idea.

    2. If there has been some kind of change, how long since it was implemented?

    See answer to number 1. ;)

    If you're up for some experimentation try replacing this line

    Redirect 301 /go/myproduct http://www.myproduct.com

    With these lines instead

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule go/myproduct(.*) http://www.myproduct.com/ [R=301,L]
    </IfModule>

    If mod_rewrite is activated and allowed for your directory then just like the WordPress section that should do it. I added the (.*) just in case.

  3. shadowboxa
    Member
    Posted 1 year ago #

    Yes, I will try those.

    What is especially interesting is that there are many different windows and linux based hosts, which all have the same problem, which appear to have occurred at the same time.

    Just has my head swimming :P

  4. I forget why exactly but I never use that Redirect 301 syntax. I'm pretty sure it's part of mod_alias and not mod_rewrite.

    If your host zapped mod_alias then that would do it. ;) Lots of things use mod_rewrite besides WordPress so that syntax should be safer to use in the long run.

Topic Closed

This topic has been closed to new replies.

About this Topic