Announcement

Collapse
No announcement yet.

mod_rewrite

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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.

  • #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


    • #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:
      RewriteEngine on
      
      # This file is only needed if you have set the Forum Component URL in your admincp and you are 
      # using the mod_rewrite option for friendly urls. If this is the case, copy this file
      # to your forum component stub directory.
      
      # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your forum component directory.
      # RewriteBase /forum-stub-directory/
      
      # If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
      # Options -MultiViews
      
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -l [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      
      RewriteRule ^.*$ - [NC,L]
      
      # Forum
      RewriteRule ^threads/.* showthread.php [QSA]
      RewriteRule ^forums/.* forumdisplay.php [QSA]
      RewriteRule ^members/.* member.php [QSA]
      


      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


      • #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...
        X