Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: HTTP to HTTPS redirect advice

  1. #11
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Ahhh... GoDaddy... there is the issue.

    They run php through CGI, but they use their own coding. Try this and let me know what happens. If this doesn't work, we will need to get some information from your CPanel log in.

    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    Options +ExecCGI
    AddHandler application/x-httpd-lsphp .html
    AddType audio/ogg .oga
    AddType video/ogg .ogv
    AddType application/ogg .ogg
    AddHandler application-ogg .ogg .ogv .oga
    
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    
    <Files ~ "^\.(htaccess|htpasswd)$">
    deny from all
    </Files>
    Options Indexes
    order deny,allow
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>
    
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    We may need to remove your deflate arguments as well. I can't remember if GD allows deflation or not. I will have to research.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  2. #12
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,085
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    I have applied & left the code is post #11 now in the htaccess file for you to see etc.
    This also did not work.

    Also shows same message as before.

    Thanks
    If i need to go to c panel can you advise path etc so i can get the info you require quickly.

    Thanks

  3. #13
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Before we do all of that, let's figure out what is breaking the .htaccess file. One or more of the solutions should have already worked, even in GoDaddy.

    Start with this and let me know what happens.

    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    Options +ExecCGI
    AddHandler application/x-httpd-lsphp .html
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #14
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,085
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Hi that worked ok.

    Code:
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    Options +ExecCGI
    AddHandler application/x-httpd-lsphp .html

  5. #15
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Just go through and make sure all the other elements of your site work as expected.

    I figured most of that was overlay from the previous host, which you probably don't need anymore. If you find that you do, just let me know and we will get the right coding for it.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #16
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,085
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    I have been looking around but i dont see any issues,basically what ever i click on etc it does what it is supposed to do.

    With respects of the old code i dont know what it did anyway but do you think we should put it in or just leave it as it is ?

    Thanks

  7. #17
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    I wouldn't add anything you don't need.

    Code:
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    Basically, this is a cookie expiry module. Probably left over from a script that was run on the old server. Unless you actually need to control cookies for a particular reason, this can be left out. One example of a requirement would be a sign up pop up. If the user sees the pop up and closes it, the expiry wouldn't show that pop up to them again for XX number of days. It's basically useless except in direct marketing.

    Code:
    <Files ~ "^\.(htaccess|htpasswd)$">
    deny from all
    </Files>
    Options Indexes
    order deny,allow
    All this is doing is preventing anyone from directly accessing your .htaccss file. However, with Apache, there is no direct access anyway and most reliable servers will have this encoded in the main file on the whole server. There is no need for it.

    Code:
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>
    Again, this is probably from the old server. GoDaddy uses FastCGI and the cache modules are already there. This forces them to run again, which can slow down the server or break your site. Either way, if it is already run, you don't need to run it again.

    Code:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    This is a compression force value for each of the file types. It is used to speed up load times of your site for the client side (visitors). Unless you are running HUGE amounts of scripting and server side cache, implimentation and other such things, the compression won't really matter much. You may leave this out and only suffer a few miliseconds of laod time, which isn't enough to kick anyone off your site because images and scripts aren't loading.

    Code:
    AddType audio/ogg .oga
    AddType video/ogg .ogv
    AddType application/ogg .ogg
    AddHandler application-ogg .ogg .ogv .oga
    This allows your site to process and play .ogg files which are native to Linux. The Vorg Obb file format is similar to .wav for windows. If you aren't posting any .ogg files, there isn't a need to have this either. If you are, there are better ways to display them (and you should have mp4 and mp3 back ups running anyway).

    If nothing is broken, I would suggest you just leave it as is. Bloat isn't needed.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #18
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,085
    Thanks
    157
    Thanked 3 Times in 3 Posts

    Default

    Thanks for your time & effort with this.
    I will leave the code which is running at present.

    Cheers & have a nice day.

  9. #19
    Join Date
    Feb 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i face problem i open my website he show unprotected but i install HTTPS help me.

    Mod Note: rishimtt, Please do not edit this post further.
    Last edited by james438; 02-09-2019 at 08:10 AM. Reason: Removed hotlink

  10. #20
    Join Date
    Feb 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    How can change in WordPress?

Similar Threads

  1. Replies: 0
    Last Post: 04-16-2013, 07:44 AM
  2. Need to iframe an https layered url on an http site
    By avdistribution in forum Looking for such a script or service
    Replies: 0
    Last Post: 05-14-2008, 03:08 AM
  3. http/ https problem
    By gavintat in forum PHP
    Replies: 2
    Last Post: 02-19-2008, 06:03 AM
  4. How to redirect to a HTTPS pages using DD script
    By ajaxdude in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 12-14-2006, 06:12 AM
  5. Access https in http page
    By ymdomar in forum JavaScript
    Replies: 3
    Last Post: 12-13-2006, 01:17 AM

Bookmarks

Posting Permissions

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