mod_rewrite

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mythotical
    Senior Member
    • May 2004
    • 234
    • 5.6.4

    [CMS] mod_rewrite

    What happened to the .htaccess file that used to come with vBulletin 4? Kinda sucks that it doesn't now as I know jack about mod_rewrite and right now my site is experiencing issues so I'm working with my host for a solution but just in case I'm posting here.

    Currently I am getting 404 when I use the following code:
    Code:
    RewriteEngine OnRewriteBase /
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^forums/(index.php)?$ forum.php?%{QUERY_STRING}
    RewriteRule ^blogs/(index.php)?$ blog.php?%{QUERY_STRING}
    Not sure how it would work including /forums/ in theres or blogs but if it would work I wouldn't care.

    Any ideas or suggestions would be greatly appreciated.
  • Hartmut
    Senior Member
    • Nov 2007
    • 2870
    • 4.2.x

    #2
    Did you upload the file to your forum root? And did you change the setting in AdminCP -> Settings -> Options -> Friendly URLs -> URL Type -> Mod Rewrite Friendly URLs
    No private support, only PM me when I ask for it. Support in the forums only.

    Comment

    • Mythotical
      Senior Member
      • May 2004
      • 234
      • 5.6.4

      #3
      Yes and yes. Hosting company is even scratching their head at why it won't work. What is the code to disable plugins? I will try that as well.

      - - - Updated - - -

      Nevermind the disable plugins, I found it but plugins are not causing the issue. So not sure what else could be.

      - - - Updated - - -

      Ok not sure but did a specific search of vb.org and found this:
      Code:
      [COLOR=#000000][FONT=verdana]RewriteEngine on[/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]# This file is only needed if you have set the Forum Component URL in your admincp and you are [/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]# using the [/FONT][/COLOR][COLOR=#0000FF][FONT=verdana][B]mod_rewrite[/B][/FONT][/COLOR][COLOR=#000000][FONT=verdana] option for friendly urls. If this is the case, copy this file[/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]# to your forum component stub directory.[/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.[/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]# RewriteBase /forum-stub-directory/[/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.[/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]# Options -MultiViews[/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]RewriteCond %{REQUEST_FILENAME} -f [OR][/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]RewriteCond %{REQUEST_FILENAME} -l [OR][/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]RewriteCond %{REQUEST_FILENAME} -d[/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]RewriteRule ^.*$ - [NC,L][/FONT][/COLOR]
      
      [COLOR=#000000][FONT=verdana]# Forum[/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]RewriteRule ^threads/.* showthread.php [QSA][/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]RewriteRule ^forums/.* forumdisplay.php [QSA][/FONT][/COLOR]
      [COLOR=#000000][FONT=verdana]RewriteRule ^members/.* member.php [QSA]
      [/FONT][/COLOR]


      Now I need to add stuff for blogs, gallery, etc.


      - - - Updated - - -

      Here is what I need help with now, trying to do some proper friendly URLs for user blogs, blog entries, articles, and image gallery.

      Can anyone help with that?

      Comment

      • Lynne
        Former vBulletin Support
        • Oct 2004
        • 26255

        #4
        There is still .htaccess included with vbulletin. It is in the do_not_upload/rewrite/apache2 directory. You must be able to view invisible files in order to see it.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools <- awesome site for html/css help

        Comment

        Related Topics

        Collapse

        Working...