Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other 301 Redirect http to https same page name

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #255753
    thpcss
    Participant

    Hi, hope someone can help. I have recently installed a SSL Certificate on my site and in the process of creating 301 redirects via the .htaccess file for nearly 400 page urls (to keep Google happy and my page rankings). I thought of using;

    redirect 301 /contact.php https://www.mydomainname.co.uk/contact.php
    redirect 301 /services.php https://www.mydomainname.co.uk/services.php
    etc

    but it breaks the site. The only solution I have seen is;

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule ^contact.php$ https://www.mydomainname.co.uk/contact.php [L,R=301]

    The above seems a lot of code to use for each of the 400 pages! is there a quicker way with less code I can use in the .htaccess file?

    Many thanks. Hope someone can advise.

    #255755
    Beverleyh
    Participant

    Maybe this is what you’re looking for?

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

    For more help, try Googling “redirect http to https htaccess”.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.