htaccess redirect

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

    htaccess redirect

    I'm not at all familiar working with htaccess. But I recently set my site to ssl and want to redirect. I have found the redirect code for http to https, but which htaccess file gets modified ( I assume the one in "upload" folder, or in my case "forum" directory. Then, does it matter where in the file the script is placed?
    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.
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24358
    • 5.7.X

    #2
    I would add it to the start of the file before any of the vBulletin redirects.
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • William Thomas Jr
      Senior Member
      • Nov 2014
      • 526
      • 5.1.x

      #3
      Originally posted by NumNum
      I'm not at all familiar working with htaccess. But I recently set my site to ssl and want to redirect. I have found the redirect code for http to https, but which htaccess file gets modified ( I assume the one in "upload" folder, or in my case "forum" directory. Then, does it matter where in the file the script is placed?
      Here's an example, my .htaccess in case you need to peek. You want to mod the .htaccess in your root directory. I'd recommend backing it up first. If you mess up your site will go down.

      Situs slot pulsa indosat memberikan terobosan terbaru untuk memainkan slot via pulsa indosat dimanapun penggemar slot indosat berada.


      The first three lines after "rewrite on" are my http to https.

      You may also want to check out Vbmods that rock too if you're using cloudflare. Can't remember if you mentioned that you were in the past. There's a tweak in there worth noting: https://vbmods.rocks/forum/vbulletin...cached-content

      Enjoy,
      William

      Comment


      • Craig
        Craig commented
        Editing a comment
        Thanks William!
    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 74123

      #4
      This is the order of rewrites in the 5.3.0 .htaccess file:

      Code:
      [B]    #To redirect users to the secure version of your site, uncomment the lines below 
          #RewriteCond %{HTTPS} !=on
          #RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L][/B]
      
          # Send css calls directly to the correct file VBV-7807
          RewriteRule ^css.php$ core/css.php [NC,L]
      
          # Redirect old install path to core.
          RewriteRule ^install/ core/install/ [NC,L]
      
          # Main Redirect
          RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
      
          # Because admincp is an actual directory.
          RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
      Translations provided by Google.

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

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...