SO...How did you guys pull it off? (.htaccess)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phdev
    New Member
    • Dec 2006
    • 17
    • 3.6.x

    SO...How did you guys pull it off? (.htaccess)

    I run a forum in the /forum/ directory and I can't get .htaccess to redirect users from the non-www version to the www version. I see that this is done on the vbulletin.com website so please tell me how to do it.

    I've seen many threads on how to redirect the root, but I need the .htaccess to do it if my forum is in /forum/

    Thank you!
  • mhc1576
    New Member
    • Oct 2005
    • 18
    • 3.6.x

    #2
    RewriteEngine on
    RewriteRule ^/$ http://www.domain.com/forum [L,R=301]

    Comment

    • phdev
      New Member
      • Dec 2006
      • 17
      • 3.6.x

      #3
      Hi, that did not work - when I type in phenforum.com/forum in my browser, it doesn't redirect to the www version.

      What can I do?

      Comment

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

        #4
        Does your server have mod_rewrite turned on?

        Also note, this only works for Apache and not IIS. You need additional software installed on the server for IIS to recognize .htaccess files but even then I am not sure if it supports mod_rewrite commands.

        Anyway, you should contact your hosting provider. This is actually outside the vBulletin software and they would be able to provide better support for their server setup and enabling features like this on your site.
        Translations provided by Google.

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

        Comment

        • phdev
          New Member
          • Dec 2006
          • 17
          • 3.6.x

          #5
          Yes, I am successfully using other mod rewrite stuff. My site actually depends on it to have the SE friendly urls i do.

          Comment

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

            #6
            Then it is possible that those rules are superceding your new rule depending on the order they are executed in and the syntax of the rules. I would suggest talking to whoever set up the SE friendly URLs. Maybe there is something you need to change in them as well.
            Translations provided by Google.

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

            Comment

            • phdev
              New Member
              • Dec 2006
              • 17
              • 3.6.x

              #7
              Here is my current .htaccess. I removed the suggestion made by our friend above because it didn't work for me.

              Options All -Indexes

              RewriteEngine On

              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule ^(.*) index.php


              RewriteCond %{HTTP_HOST} !^www\.
              RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

              Redirect 301 /login http://www.phenforum.com/amember/profile.php

              Comment

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

                #8
                You might get more help here:


                From what little I know, the following two lines should be doing what you want:

                RewriteCond %{HTTP_HOST} !^www\.
                RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
                Translations provided by Google.

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

                Comment

                Related Topics

                Collapse

                Working...