Announcement

Collapse
No announcement yet.

Redirect url of now non-existent page

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

  • Redirect url of now non-existent page

    Now I have upgraded to vB5 from vB3 a previous landing page /forum/cmps-index.php (vBA CMPS CMS) no longer exists.

    What is the best way to redirect requests to the old landing page to, say, /forum or /forum/Home ?

    I tried a redirect from the site root .htaccess but that doesn't work (I get ?routestring=cmps_index.php appended to the url)

    Thanks

  • #2
    You may be able to add a specific 301 redirect in the .htaccess file above where it says "#Main Redirect". Shouldn't be necessary though. The included .htaccess file should already do this redirect. Is it not doing this?

    The routestring parameter shouldn't hurt things and will be ignored by the software. You should encourage your users to index your site's domain instead of a file.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      I'm a bit confused - should the redirect work from the website root .htaccess (which is what I did) or should I put it in only in the forum .htaccess?

      Comment


      • #4
        It is best to put things affecting vBulletin in the .htaccess for vBulletin. So in /forum/.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          The page half loads but instead of the content I get:

          "Invalid Page URL. If this is an error and the page should exist, please contact the system administrator and tell them how you got this message."

          The url looks like this:

          https://my-site.com/forum/Home/?rout...cmps_index.php

          I'm trying to redirect to: https://my-site.com/forum/Home/

          Comment


          • #6
            You would have to create a rewrite rule to redirect cmps_index.php to index.php in your vBulletin .htaccess file. There are literally thousands of tutorials out there to do this. The exact one would depend on your server. Which I know nothing about.

            Or you can redirect 404 errors to your homepage in the AdminCP under Settings -> Options -> General Settings.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment


            • #7
              I'm sorry but nothing I try avoids the problem of ?routestring=cmps_index.php being appended to the required destination url and that prevents the destination page from loading properly.

              The forum is hosted on an Apache CentOS/Linux

              The AdminCP settings workaround does work but isn't really what I wanted (to point to a specific forum page, not just to /forum)

              Comment


              • #8
                What do you have for your redirect in the .htaccess file?

                Though, your hosting provider is better equipped to handle server configuration issues like this.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API - Full / Mobile
                Vote for your favorite feature requests and the bugs you want to see fixed.

                Comment


                • #9
                  Originally posted by Wayne Luke View Post
                  What do you have for your redirect in the .htaccess file?
                  For example: Redirect 301 /forum/cmps_index.php https://mysite.com/forum/Home/

                  Or even Redirect 301 /forum/cmps_index.php https://mysite.com/forum/

                  Though, your hosting provider is better equipped to handle server configuration issues like this.
                  That's a fair point though isn't the issue specific to vBulletin 5?

                  Comment


                  • #10
                    You really shouldn't try redirect to a specific page. You should allow vBulletin to maintain the homepage so that your base URL gets you there. This will prevent this exact issue from occurring in the future. The first thing you need to do is edit your /Home page and click the "Make this page the home page" check box when saving the page. Then you're URL becomes: https://mysite.com/forum/. If you set another page as your Home Page in the future, then the URL remains the exact same.

                    Next your redirection code in the .htaccess file MUST exist and be processed after the RewriteBase directive and before these lines:

                    Code:
                    # Main Redirect
                    RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
                    I would suggest using a Rewrite instead of a Redirect. Something like:

                    Code:
                     RewriteRule    "^/cmps_index\.php$"  "index.php"  [R]
                    So you would end up with something like:

                    Code:
                     RewriteRule    "^/cmps_index\.php$"  "index.php"  [R]
                    
                    # Main Redirect
                    RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud demonstration site.
                    vBulletin 5 API - Full / Mobile
                    Vote for your favorite feature requests and the bugs you want to see fixed.

                    Comment


                    • #11
                      Originally posted by imager View Post
                      That's a fair point though isn't the issue specific to vBulletin 5?
                      No. It is due to having a customized homepage and never renaming cmps_index.php to index.php as specified in that third-party product's installation steps.
                      Translations provided by Google.

                      Wayne Luke
                      The Rabid Badger - a vBulletin Cloud demonstration site.
                      vBulletin 5 API - Full / Mobile
                      Vote for your favorite feature requests and the bugs you want to see fixed.

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X