Trailing slash redirects not working in https - working in http: What might be the culprit?

1 replies
  • SEO
  • |
Hi,

Our WP website redirects without slash to with slash are not working. When we tried with http mode, they are working. So, not working on https mode. Correct code given at .htaccess file. What might be causing the issue?

Thanks
#culprit #http #https #redirects #slash #trailing #working
Avatar of Unregistered
  • Profile picture of the author paulgl
    Who's "we"? You got a mouse in your pocket?

    How many redirects do you want?

    You can do 3,2, or 1.

    One is better, but most use the 2 redirect solution.

    One is better because who knows how many redirects google actually follows, and, why keep the visitor in suspense any longer....Sure, internet is fast these days...but who knows what the end user has...

    There are complete codes for htaccess online if you google it.

    ------sample code below-----

    RewriteEngine on

    RewriteCond %{REQUEST_URI} /(.+)/$
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ https://www.example.com/%1 [R=301,L]

    RewriteCond %{REQUEST_URI} !(.+)/$
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^(.+)$ https://www.example.com/$1/ [R=301,L]

    RewriteCond %{HTTP_HOST} !^www\.(.*)$ [OR,NC]
    RewriteCond %{https} off
    RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]


    Only one 301 for each combination of www, https, or slash!

    I'd do all 3 cases, but each filter gives one 301.

    Just put your own domain in place of example.

    Paul
    Signature

    If you were disappointed in your results today, lower your standards tomorrow.

    {{ DiscussionBoard.errors[11498184].message }}

Trending Topics