• I just upgraded to an SSL for my website, and I need to write a 301 redirect for the new location. This is what I have now:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.yourcruiseyourway.com/wordpress', 'http://www.yourcruiseyourway.com');
    Redirect 301 /wordpress/ http://www.yourcruiseyourway.com/
    # END WordPress

    and this is what I need to add:

    RewriteEngine on
    rewritecond %{http_host} ^yourcruiseyourway.com [nc]
    rewriterule ^(.*)$ http://www.yourcruiseyourway.com/$1 [r=301,nc]

    So where do I insert the second part into the first part to make it work corrcetly and show my site as https:?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gatorgse

    (@gatorgse)

    anyone on that might be able to comment?

    Thanks

    1. youve pasted stuff that does not belong in an .htaccess, specifically this:


    UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.yourcruiseyourway.com/wordpress&#8217;, ‘http://www.yourcruiseyourway.com&#8217;);

    I dont know where you got that from but thats not going to do anything.

    2. If you are requiring SSL for all access to the site, you dont need to use mod_rewrite, all you need to do is use the SSL url in your URL option thats located in the backend..

    If you are intent on rewriting http to https then those rules need to go above your WP rules. Place them outside of the “Begin WordPress” stuff also.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.htaccess with more than one command’ is closed to new replies.