Announcement

Collapse
No announcement yet.

Apache redirect not working because of '?routestring=xxx'

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

  • Apache redirect not working because of '?routestring=xxx'

    I had an article I published; I decided I wanted it to be a forum post instead, so I copied it and made a new forum post, and deleted the article.

    I then decided I wanted to make the old article's URL redirect to the new forum article, so I created the usual Apache redirect in my .htaccess file. It doesn't work, because the redirected url gets this "routestring" language appended to it.

    Since these are really long URLs, this is kinda hard to read, but here's the .htaccess:

    Code:
    Redirect permanent /vb/news-and-articles/news/222-video-sept-7th-open-meeting-on-removal-of-a-director        https://mydomain.com/vb/forum/the-preserve-community/hoa-business/223-video-recording-of-sept-7th-2018-open-meeting
    When you click on a link to go to the OLD article, it does not forward to the forum post as it should, but returns "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."

    Here is the actual URL that gets sent to the browser. It is the correct forum post URL, except it has this ?routestring=xxxx (the previous URL) appended to it, which makes it malfunction.

    Code:
    https://mydomain.com/vb/forum/the-preserve-community/hoa-business/223-video-recording-of-sept-7th-2018-open-meeting?routestring=news-and-articles/news/222-video-sept-7th-open-meeting-on-removal-of-a-director

    I assume that VB is adding this, but why would that be and is there anything I can do to correct this?

  • #2
    It's necessary to maintain the controller class / function / id parameters.

    I'm slightly confused. If you deleted the article the old URL would no longer exist which would result in an invalid page URL error.

    Comment


    • #3
      Thanks for hijacking my thread.

      I didn't get any answer to the actual question. This has nothing to do with VB3 or VB4. I simply, in VB 5, had an article pubished. I decided I wanted it to be a forum post instead, so I rewrote it as a forum post and deleted the article. Then I just wanted to make a redirect so the old article URL went to the new forum URL. But it doesn't work, because some thing adds this "?routestring=xxx" to the URL which makes it malfunction. I will paste again the info here:

      Since these are really long URLs, this is kinda hard to read, but here's the .htaccess:
      (the first part is the old URL, the second part is the new URL)

      Code:
      Redirect permanent /vb/news-and-articles/news/222-video-sept-7th-open-meeting-on-removal-of-a-director        https://mydomain.com/vb/forum/the-preserve-community/hoa-business/223-video-recording-of-sept-7th-2018-open-meeting
      When you click on a link to go to the OLD article, it does not forward to the forum post as it should, but returns "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."

      Here is the actual URL that gets sent to the browser (by the above Apache redirect). It is the correct forum post URL, except it has this ?routestring=xxxx (the previous URL) appended to it, which makes it malfunction.

      Code:
      https://mydomain.com/vb/forum/the-preserve-community/hoa-business/223-video-recording-of-sept-7th-2018-open-meeting?routestring=news-and-articles/news/222-video-sept-7th-open-meeting-on-removal-of-a-director
      I assume that VB is adding this, but why would that be and is there anything I can do to correct this?

      Comment


      • #4
        --- I've deleted the off-topic and irrelevent posts.

        1) Make sure it is above the main redirect in the .htaccess file.
        2) Add ' [L]' (there is a leading space) at the end of your redirect.

        It should then pass the new URL to vBulletin's main redirect.

        The other way is by manipulating the database directly but that is more difficult.
        Last edited by Wayne Luke; Yesterday, 11:07am.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #5
          Thanks - what do you mean by the "main redirect"?

          Comment


          • #6
            The main redirect is marked in the .htaccess file:


            # 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]
            Originally posted by StephenKay View Post
            Thanks - what do you mean by the "main redirect"?

            Comment


            • #7
              The links in the subject are not clear
              I develop real links and not examples
              I think you can not redirect article links to forum topics
              Due to differences in subject ID and articles

              Comment

              Working...
              X