Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 38

Problem with moving posts with Nginx

This is a discussion on Problem with moving posts with Nginx within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Hello, I've been using Nginx for awhile now and have had this issue. My workaround has been to simply switch ...

  1. #1
    Junior Member
    Real Name
    Jim Ohlstein
    Join Date
    Apr 2006
    Location
    Virginia Beach
    Posts
    19
    Liked
    0 times

    Problem with moving posts with Nginx

    Hello,

    I've been using Nginx for awhile now and have had this issue. My workaround has been to simply switch off vBSEO when I need to move posts or merge threads and then switch it back on. This is obviously not a good long term solution.

    I am using the following rewrites as per howto for nginx :
    location /forums/ {

    rewrite ^/forums/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;

    if ($request_filename ~ "\.php$" ) {
    rewrite ^(.*)$ /forums/vbseo.php last;
    }

    if (!-e $request_filename) {
    rewrite ^/forums/(.*)$ /forums/vbseo.php last;
    }

    }
    When I attempt to move a post from one thread to another using the rewritten URL that ends in ".html" I get the following error message:

    vBulletin Message

    You have not specified a valid URL for the thread that you want to merge. Please check that the URL includes a valid threadid, "t=xxx" or postid, "p=xxx" (where xxx is a number), and is not a redirect.
    Any ideas?

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Hello,

    looks like *.php requests are not preprocessed by vBSEO. Can you open a ticket with server access details for troubleshooting?

  3. #3
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    An update:
    I've moved this section to the bottom of nginx config:
    Code:
    if ($request_filename ~ "\.php$" ) {
    rewrite ^(.*)$ /forums/vbseo.php last;
    }
    It seems to work correctly now.

  4. #4
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    Oleg, I'm having the same problem. By: "I've moved this section to the bottom of nginx config:"

    Do you mean that you moved it to the bottom of the directives within the location body for vbseo rewrites, or did you move it out of the location body and place it directly in the bottom of the config with no nesting/conditionals?

    Thanks much.

  5. #5
    nfn
    nfn is offline
    Senior Member
    Real Name
    Nuno
    Join Date
    Feb 2008
    Location
    Portugal
    Posts
    276
    Liked
    1 times
    Quote Originally Posted by RequiemTCE View Post
    move it out of the location body and place it directly in the bottom of the config with no nesting/conditionals
    To the bottom without any location directive.

  6. #6
    Junior Member
    Real Name
    Andrew Hunn
    Join Date
    May 2007
    Posts
    3
    Liked
    0 times
    Moving that directive to the bottom without location fixes post moving, but it also ends up processing a bunch of non-stock PHP scripts we have in subdirectories of root. Why is that post moving (incidentally, post to new thread works, but post to established thread does not) appears to be accessing a script outside of /?

    In short, I need a solution for both issues, because both are basically deal-breakers for my site at this point.

  7. #7
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    Yes, this is a problem. vBSEO redirects to the main page on scripts that it doesn't know on the entire site when you move it out of the location directive.

    Does anybody know why moving it out of the location directive fixes the problem with moving posts?

  8. #8
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    nginx is gaining market share rapidly, having recently blown by lighttpd. Many large site owners are giving it their praises and eva2000 all but officially endorses it here on this thread: nginx - the raise of a new giant - vBulletin Community Forum

    This is something you people should probably be supporting. Very few of your customers are likely to have nothing but vBulletin on their entire site, and many are and will be moving in this direction.

  9. #9
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    You should include the forums folder name in rewrite rule to avoid processing of other scripts, like:
    Code:
    if ($request_filename ~ "\.php$" ) {
    rewrite ^/forums/(.*)$ /forums/vbseo.php last;
    }

  10. #10
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    The site in question exists in the documentroot so that isn't an option, and that wouldn't work even if it was in /forums. It would simply redirect all php no matter where it is on the site to /forums, without a location directive.

    The solution is to figure out why it works outside of the location directive, and solve that problem.

  11. #11
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    What is an example URL that is being redirected? Make sure that you replace /forums/ with / in case if you have it in root.

  12. #12
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    Here is a snippet from the file that nginx is including for this virtual host:

    Code:
            # vbseo
            location /
            {
                    index                           index.php index.html;
                    rewrite ^/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbs$
    
                    if (!-e $request_filename)
                    {
                            rewrite ^/(.*)$ /vbseo.php last;
                    }
            }
            if ($request_filename ~ "\.php$" )
            {
                    rewrite ^(.*)$ /vbseo.php last;
            }
    Example URL would be: www.example.com/somedir/example.php

    The behavior is that any php file on the site that vBSEO does not recognize is redirected to the front page.

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    The issue only happens with php files in somefolders, not in forums folder itself? Please try this:
    Code:
    rewrite ^/([^/]*)$ /vbseo.php last;

  14. #14
    Junior Member
    Real Name
    Requiemtce
    Join Date
    Mar 2006
    Posts
    11
    Liked
    0 times
    This works:

    Code:
            # vbseo
            location /
            {
                    index                           index.php index.html;
                    rewrite ^/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
    
                    if (!-e $request_filename)
                    {
                            rewrite ^/(.*)$ /vbseo.php last;
                    }
            }
            if ($request_filename ~ "\.php$" )
            {
                    rewrite ^/([^/]*)$ /vbseo.php last;
            }
    Thanks much!

  15. #15
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Great! I'm glad we got it working

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. moving subforums below posts of forums
    By msimonds in forum General Discussion
    Replies: 8
    Last Post: 10-16-2010, 03:29 AM
  2. Heh got an odd problem since moving.
    By AdamUOF in forum Troubleshooting
    Replies: 2
    Last Post: 08-25-2008, 03:53 PM
  3. Number of posts per page - URL problem
    By NeutralizeR in forum Troubleshooting
    Replies: 2
    Last Post: 03-24-2008, 10:14 AM
  4. Vbseo Problem After Moving Forum to Root
    By huntz in forum Troubleshooting
    Replies: 3
    Last Post: 01-08-2007, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •