Announcement

Collapse
No announcement yet.

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

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

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

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

    Comment


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


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


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


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


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


              • #8
                You might get more help here:
                http://forum.modrewrite.com/index.php

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