Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    redirect using htaccess only redirects homepage

    Hi,

    Just used some coding to redirect http to https, but it only works on the homepage. When I click on a link to another page on the website it's showing a 404. How can I redirect the entire site to https properly?

  • #2
    New to the CF scene
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    Try this
    Code:
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks 
    RewriteEngine on 
    
    #	Redirecting http to https
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://www.mydomain.com/ [R=301,L]
    </IfModule>

  • Users who have thanked techlib for this post:

    PeterParker (06-30-2011)

  • #3
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hi Teclib,

    Sorry, forgot to tell you that it's a wordpress site.
    I tried your code, but probably because of wp it didn't work.

    I'm still having the 404 problem.

  • #4
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Problem solved, guys. It was a setting I had to change within WP.

  • #5
    New Coder
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi techlib,

    can you please say how to write .htaccess for redirecting my whole site into another domain


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •