Creating a redirect using htaccess and now get 404 error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Craig
    Senior Member
    • Jan 2008
    • 998
    • 6.X

    Creating a redirect using htaccess and now get 404 error

    I configured a site to https and created a redirect in htaccess and got a 404 error. I backed out the script in htaccess and still get the 404 error.
    At a loss at this point, any thoughts?

    adktramping ~ my happy place.

    "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

    Vote for your favorite feature requests and the bugs you want to see fixed.
  • Mark.B
    vBulletin Support
    • Feb 2004
    • 24288
    • 6.0.X

    #2
    Clear browser cache and restart browser.....some browsers aggressively cache this sort of thing.
    MARK.B
    vBulletin Support
    ------------
    My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
    My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

    Comment

    • Craig
      Senior Member
      • Jan 2008
      • 998
      • 6.X

      #3
      Wishful thinking, still exists.



      This is the site, click on any forum.
      adktramping ~ my happy place.

      "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

      Vote for your favorite feature requests and the bugs you want to see fixed.

      Comment

      • LockedOnLaw
        Senior Member
        • Apr 2010
        • 2311
        • 6.X

        #4
        Did you edit the root URL somewhere other than the .htaccess file? It's producing the same 404 error with the non-secure URL. My first thought is something is off in the configuration URLs.

        Comment

        • Craig
          Senior Member
          • Jan 2008
          • 998
          • 6.X

          #5
          I edited the public_html and the forum directory htaccess files. Both reverted back.

          The admincp site urls were changed to https yesterday. I was working on the redirect this morning.
          adktramping ~ my happy place.

          "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

          Vote for your favorite feature requests and the bugs you want to see fixed.

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 74161

            #6
            You broke the main redirect in the default .htaccess. What is the code you changed? What did you change it back to?
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • Craig
              Senior Member
              • Jan 2008
              • 998
              • 6.X

              #7
              Ayup I did.

              I'll explain what happened once I get home and can review my notes.

              In the meantime I uploaded the htaccess file from the backup I have. A fine example of having a backup.

              adktramping ~ my happy place.

              "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment

              • Craig
                Senior Member
                • Jan 2008
                • 998
                • 6.X

                #8
                So I had added;
                RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://www.adkhighpeaks.com/forums/$1 [R=301,L]
                But it didn't work when I navigated using http. I was running out of time for work so I deleted said script. Once I got to work I noticed my bigger issue. It wasn't until Wayne Luke mentioned I broke the main redirect that I remembered my backup copy, and uploaded it from work, bringing the site back. So, other than I must have corrupted the file, I'm not sure where I went wrong exactly.

                It's back and I'll review further.
                adktramping ~ my happy place.

                "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

                Vote for your favorite feature requests and the bugs you want to see fixed.

                Comment

                • Wayne Luke
                  vBulletin Technical Support Lead
                  • Aug 2000
                  • 74161

                  #9
                  You don't need to add "RewriteEngine On." We have have that in the .htaccess file already.

                  In the default file, look for:
                  Code:
                      #RewriteCond %{HTTPS} !=on
                      #RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
                  Change to:
                  Code:
                      RewriteCond %{HTTPS} !=on
                      RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
                  Does it work then?
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API

                  Comment

                  • Craig
                    Senior Member
                    • Jan 2008
                    • 998
                    • 6.X

                    #10
                    Those lines are not in the .htaccess file, but are in the htaccess.txt.
                    adktramping ~ my happy place.

                    "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

                    Vote for your favorite feature requests and the bugs you want to see fixed.

                    Comment

                    • Mark.B
                      vBulletin Support
                      • Feb 2004
                      • 24288
                      • 6.0.X

                      #11
                      Originally posted by NumNum
                      Those lines are not in the .htaccess file, but are in the htaccess.txt.
                      htaccess.txt is just a default copy of the htaccess file...on a new installation you rename it to .htaccess.

                      If you have no custom rules set up you could back up your existing file, remove it, rename htaccess.txt to .htaccess, and make the changes Wayne suggested.

                      Alternatively paste those lines into your existing file. Make a copy first!
                      MARK.B
                      vBulletin Support
                      ------------
                      My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                      My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                      Comment

                      • Craig
                        Senior Member
                        • Jan 2008
                        • 998
                        • 6.X

                        #12
                        That is what I ended up doing this evening.

                        There is a strip of command at the top of the existing htaccess file;
                        #max_input_time = 240
                        Any idea what command that is for?
                        adktramping ~ my happy place.

                        "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

                        Vote for your favorite feature requests and the bugs you want to see fixed.

                        Comment

                        • Mark.B
                          vBulletin Support
                          • Feb 2004
                          • 24288
                          • 6.0.X

                          #13
                          Originally posted by NumNum
                          That is what I ended up doing this evening.

                          There is a strip of command at the top of the existing htaccess file;

                          Any idea what command that is for?
                          The '#' at the start means it doesn't actually do anything - it is commented out.
                          All it would do, if uncommented, is increase the php max_input_time value.
                          MARK.B
                          vBulletin Support
                          ------------
                          My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
                          My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

                          Comment

                          • Wayne Luke
                            vBulletin Technical Support Lead
                            • Aug 2000
                            • 74161

                            #14
                            If it wasn't commented out, it looks like it is trying to set a timeout for PHP. Most likely 240 seconds. However, it isn't formatted properly.

                            https://stackoverflow.com/questions/...n-time-for-php
                            Translations provided by Google.

                            Wayne Luke
                            The Rabid Badger - a vBulletin Cloud demonstration site.
                            vBulletin 5 API

                            Comment

                            Related Topics

                            Collapse

                            Working...