Support » Fixing WordPress » Redirect not working

  • Resolved Mirre

    (@mirre)


    Hello,

    My redirects aren’t working. Can you tell me what I’m doing wrong here?
    My website: http://www.mirreopreis.nl. The code is at the bottom of the .htaccess file:

    ‘# BEGIN rlrssslReallySimpleSSL rsssl_version[2.3.2]
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} !=on [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    </IfModule>
    # END rlrssslReallySimpleSSL

    # Forceer https op http
    RewriteEngine on

    RewriteCond %{HTTPS} off
    RewriteCond http://www.%{HTTP_HOST} ^(?:www\.)?(www\..+)$ [NC]
    RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R]
    #EINDE

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change ‘RewriteCond %{HTTPS} on’ to something more sensible
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
    RewriteRule ^(.*) “/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz” [L]

    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
    RewriteRule ^(.*) “/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz” [L]

    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
    RewriteRule ^(.*) “/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html” [L]

    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\”]+ [NC]
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
    RewriteRule ^(.*) “/home/mirre/domains/mirreopreis.nl/public_html/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html” [L]
    </IfModule>

    # END WPSuperCache

    # 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

    # BEGIN Redirects
    Redirect 301 /de-keientrekkers-van-amersfoort/ https://www.mirrepreis.nl/keientrekkers-amersfoort/
    Redirect 301 /de-zeven-heuvelen/ https://www.mirreopreis.nl/fietsroute-zeven-heuvelen/
    Redirect 301 /poldermolens-utrecht/
    https://www.mirreopreis.nl/fietsroute-molenroute-utrecht/

    # END Redirects’

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tyron Bache

    (@tyronbache)

    Hello Mirre,

    You first redirect is not working because there is a typo in your target URL – https://www.mirrepreis.nl/keientrekkers-amersfoort/ – you are missing an “o”. The next two are working just fine.

    Try the following rather:

    # BEGIN Redirects
    Redirect 301 /de-keientrekkers-van-amersfoort/ https://www.mirreopreis.nl/keientrekkers-amersfoort/
    Redirect 301 /de-zeven-heuvelen/ https://www.mirreopreis.nl/fietsroute-zeven-heuvelen/
    Redirect 301 /poldermolens-utrecht/
    https://www.mirreopreis.nl/fietsroute-molenroute-utrecht/
    
    # END Redirects
    Mirre

    (@mirre)

    Thank you, it’s working now!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.