Announcement

Collapse
No announcement yet.

Changing host, redirection problems

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

  • Changing host, redirection problems

    I'm having a problem.

    Since we've been using too much bandwidth on our dedicated server lately, we have to move the forums to another host with cheaper bandwidth. I've already bought and configured this, and I set up a new subdomain for the forums. Instead of mydomain.com/forums, I want to use forums.mydomain.com

    So, what I need to do when changing host, is to redirect users to the new host. I was going to use a .htaccess file with the Redirect setting, but Apache on that server doesn't allow such settings in .htaccess files. So, I need to figure out something else.

    We have just released a new piece of software (game actually), and we're getting linked to from everywhere (even slashdot ). So I can't just delete the vB forums off the dedicated server and breake the links. I *nbeed* to sort something out here.

    I know that I can only have one public installation of vB 3.0.1, and I guess I couldn't even use the vB installation on the old dedicated server to serve a "We have moved to a new host" type of message either (like a vB message when the forums are disabled)?

    What, oh what, can I do?
    meow

  • #2
    Hi there,

    You can make a index.php file that redirects the users for you.

    PHP Code:
    <?php
    header
    ("Location: http://www.yournewsite.com/forum/");
    ?>

    Comment


    • #3
      Interesting.

      I figured that I could overwrite the vBulletin php files (like index.php, showthread.php etc) with php files with that code.

      But one problem remains, if someone are linking to showthread.php?t=3813, they would just be forwarded to my forumhome. Is it possible to not only forward users to my new host, but also rewrite the link (so if they visit mydomain.com/forums/showthread?t=3813, they are forwarded to forums.mydomain.com/showthread?t=3813).

      Would that be possible?
      meow

      Comment


      • #4
        Such a shame you can't set the 404 erorr msg yourself. Otherwise all 404 could be ending up on the new domain.

        Comment


        • #5
          I know, but can't php be used to solve my problem?

          * points to post #3 *
          meow

          Comment


          • #6
            just guessing here:


            PHP Code:
            if ($_REQUEST)
            {
            header("Location: http://www.yournewsite.com/forum/");
            }
            if (empty(
            $_REQUEST))
            {
            header("Location: http://www.yournewsite.com/forum/");

            Comment


            • #7
              Sure you didn't forget to include something there, Floris? (Both code lines are the same)

              If I go to myolddomain.com/forums, I'm forwarded to mynewdomain.com/forums

              AND

              If I go to myolddomain.com/forums/showthread.php?t=4235, I'm still just forwarded to mynewdomain.com/forums.

              It gotta be possible to add the "showthread.php?t=4235" to the url somehow.
              meow

              Comment


              • #8
                Like I said, Just guessing.

                As you can see in the code, it doesn't include any thread id catching, etc.
                If the above code works, catch the id and set it to a variable, then add the variable to the end of the header.location url.

                Comment


                • #9
                  Originally posted by Floris
                  If the above code works, catch the id and set it to a variable, then add the variable to the end of the header.location url.
                  The above code works. But I have no idea on how to "catch the id and set it to a variable, then add the variable to the end of the header.location url."

                  Mind helping me out?


                  Thanks in advance!
                  meow

                  Comment


                  • #10
                    I think you are best of asking for source code modification help on vBulletin.org which is the resource community.

                    How come you can't use .htaccess by the way?

                    It is a matter of uploading htaccess.txt to your web server and renaming it to .htaccess

                    If it errors with 'file already exists', then set your ftp client to show hidden files and .htaccess will show too. You can then edit it and add your own content to it.

                    Or .. is this a windows server?

                    Comment


                    • #11
                      No, it is a linux server. The thing is that it's specified in httpd.conf that I'm not allowed to use htaccess files. I get a server-error.
                      meow

                      Comment

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