• Resolved Patrick

    (@randomgift)


    Hi there, Im using htaccess to redirect some old blog posts, following some advice I got in another forum string.
    
    However, every time I try to add the new htaccess I get an internal error, could someone tell me what I've done wrong here?
    
    Thanks in advance.
    
        # 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
    
    redirect 301 /real-mortgage-for-real-people https://www.mortgageadvicecenter.co.uk/mortgage-news
    redirect 301 /are-you-not-the-perfect-mortgage-applicant https://www.mortgageadvicecenter.co.uk/mortgage-news
    redirect 301 /there-are-funds-available-to-borrowers https://www.mortgageadvicecenter.co.uk/mortgage-news
Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Patrick

    (@randomgift)

    Apologies for placing all of that in code! The explaination says:
    Hi there, Im using htaccess to redirect some old blog posts, following some advice I got in another forum string.

    However, every time I try to add the new htaccess I get an internal error, could someone tell me what I’ve done wrong here?

    Thanks in advance.

    Thread Starter Patrick

    (@randomgift)

    Anyone know why this isn’t working?

    yes indeed I do ??

    First of all – the wordpress rules are redirecting every URL (that are not real files or directories) to index.php. So – this means that the .htaccess file will never execute your last rules of redirects.

    However; in your case that wouldn’t do much of a difference; you see – htaccess files are a bit more tricky than common logic dictates: You might very well experience, if you move your “Redirect 301” lines above the mod_rewrite rules, that they will still have no effect – mod_rewrite always gets executed BEFORE any redirect statements.

    So; you will have to convert them to “RewriteRule” statements instead I am agraid.

    (so in conclussion: 1) move the three lines ABOVE the #being wordpress. If this works – hurray. 2) convert the lines to rewrite lines instead.

    Thread Starter Patrick

    (@randomgift)

    Hi there,

    Thanks so much for taking the time to respond. Option 1 didn’t work – still got the internal error 500.

    How would I go ahead with option 2?

    Thanks again.

    Thread Starter Patrick

    (@randomgift)

    Also, is this the only option?

    Thanks

    Thread Starter Patrick

    (@randomgift)

    @wptorgue – any more ideas? Thanks!

    I had the very same question. After a lot of digging I was able to figure it out. Try something like this…

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^real-mortgage-for-real-people$ https://www.mortgageadvicecenter.co.uk/mortgage-news/ [R=301,L]
    RewriteRule ^are-you-not-the-perfect-mortgage-applicant$ https://www.mortgageadvicecenter.co.uk/mortgage-news/ [R=301,L]
    RewriteRule ^there-are-funds-available-to-borrowers$ https://www.mortgageadvicecenter.co.uk/mortgage-news/ [R=301,L]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    Thread Starter Patrick

    (@randomgift)

    Thanks very much for taking the time to respond ??

    Hi,

    I know this is kind of an old thread but I tried this solution for my site and I had no luck. I am getting an Internal Error 500. I think this has to do with the fact that my WordPress site is @ /home rather than in the index.

    Any suggestions to making this work for me?

    Hi everyone,

    I had this same problem and tried a few different methods including those above and nothing worked.

    I installed this plugin: https://www.ads-software.com/extend/plugins/simple-301-redirects/

    and that seems to have done the job, although certain URL’s that contained brackets – ( or ) – are still not redirecting so I think that may be what was causing the problem.

    I also noticed as I was adding the URLs in to the plugin that I had a couple of errors in the list of 301’s that was causing the 500 internal error, but even with these removed the other redirects didn’t work (they just went to the new WP homepage instead of the new URL)

    I recently added 301 redirects to a WP htaccess file that didn’t contain any of these funky characters in the URLs and everything worked fine, so I’m fairly sure they are likely to be the culprit.

    Hope this is of some help to other people experiencing this annoying issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Using htaccess to 301 redirect, not working’ is closed to new replies.