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

nginx + vBSEO rewrite problem

This is a discussion on nginx + vBSEO rewrite problem within the Troubleshooting forums, part of the vBSEO SEO Plugin category; Hello, There's this small rewrite problem that I'm encountering with vBSEO and nginx + php-fcgi. On the forum home the ...

  1. #1
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times

    nginx + vBSEO rewrite problem

    Hello,

    There's this small rewrite problem that I'm encountering with vBSEO and nginx + php-fcgi. On the forum home the links would appear to have been properly rewritten but when you click on the links, they are rewritten back to the old urls.

    Example:

    If I right click on the "latest post" link on the homepage it shows as "http://www.istorya.net/forums/politics-and-current-events/158852-is-the-acting-mayor-rama-just-a-puppet-of-on-leave-mayor-osmena-new-post.html" but when I click it or even paste it on the browser, it becomes "http://www.istorya.net/forums/showthread.php?p=3755104#post3755104"

    Anyone else having this issue? I've tried re-arranging the rewrite rules in nginx as suggested somewhere and went beyond and re-arranged it to all possible combination but nothing seems to be working. Everything else looks fine however. Any help will be highly appreciated.



    Best Regards

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

    please try this: Problem with moving posts with Nginx
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times
    Hi Oleg,

    That's my config now and it's still not working. Here's my /forums/ rewrite rules.

    Code:
    # Forums rewrite
            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;
            }
    
            if ($request_filename ~ "\.php$" ) {
            rewrite ^(.*)$ /forums/vbseo.php last;
            }
    
    
            }


    Best Regards

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Please try to put it to the bottom of your *complete* nginx config list, not just in rewrite rules section.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times
    That one worked to a certain extent... however it still isn't rewriting properly.

    Right click shows:
    Code:
    http://www.istorya.net/forums/networking-and-internet/145206-trixbox-asterisk-vicidial-kung-kama-o-mo-ani-istorya-ta-diri-thanks-new-post.html
    Then it rewrites to:
    Code:
    http://www.istorya.net/forums/networking-and-internet/145206-trixbox-asterisk-vicidial-kung-kama-o-mo-ani-istorya-ta-diri-thanks-3.html#post3757425

  6. #6
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    It is how it suppose to work
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  7. #7
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times
    I see. I didn't take notice of how it worked with Apache before... Thanks for the help.

  8. #8
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    You're welcome
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  9. #9
    Member
    Join Date
    Nov 2005
    Posts
    44
    Liked
    0 times

    Album

    I'm using vbseo as well as nginx, and the album images that i set to file system simply don't show they say page not found (404), any idea why? Thanks

  10. #10
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    What is an example URL that is not working?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  11. #11
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times
    Just noticed another problem. After putting the rewrite rule outside of the "forums" rewrite, it made my gallery inaccessible. Just makes it "blank". There are no error messages as well.

    http://www.istorya.net/gallery/

  12. #12
    Member
    Join Date
    Nov 2005
    Posts
    44
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk View Post
    What is an example URL that is not working?

    AnimeCrazy.net Forums - The True Anime Streaming Community

    Go to the bottom also:

    AnimeCrazy.net Forums - The True Anime Streaming Community - Pspcrazy's Album: Test Albume - Picture

    but the thumbnail here works so it's not an image issue, it's a rewrite issue:

    AnimeCrazy.net Forums - The True Anime Streaming Community - Pspcrazy's Album: Test Albume

    Here's my rewrite for the forums:

    Code:
    server
    {
    listen 192.168.93.207:80;
    server_name realsite.net www.realsite.net;
    root /home/user/realsite.net/httpdocs;
    
    if ($host != 'www.realsite.net' ) {
    rewrite ^/(.*)$ http://www.realsite.net/$1 permanent;
    }
    
    location ~* i.+\.(css|js|jpg|jpeg|gif|png)$
        {
        expires      7d;
        }
    
      location /
        {
        index  index.php index.html;
    
        # Basic version of Wordpress parameters, supporting nice permalinks.
        # include /usr/local/nginx/conf/wordpress_params.regular;
        # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
        include /usr/local/nginx/conf/wordpress_params.super_cache;
        }
    
    
    location /forums/ {
    root /home/user/realsite.net/httpdocs;
    rewrite ^/forums/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
    
    if (-f $request_filename) {
    expires 30d;
    break;
    }
    
    if ($request_filename ~ "\.php$" ) {
    rewrite ^(.*)$ /forums/vbseo.php last;
    }
    
    if (!-e $request_filename) {
    rewrite ^/forums/(.*)$ /forums/vbseo.php last;
    }
    
    }
    
    
    location ~* \.(php)$
    {
    root /home/user/realsite.net/httpdocs;
    fastcgi_pass 127.0.0.1:9000;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
    }
    I believe I had fixed this issue when i was using apache by having the word album|avatar|sigpic or something that looked like that in my old htaccess which i can't find.

    The folder I use for albums is album , and i use the file system for them.

    What code do you suggest I use to get them to work? Thanks

  13. #13
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Gerald,

    please try to change that section to:
    Code:
            if ($request_filename ~ "\.php$" ) {
            rewrite ^(/forums/.*)$ /forums/vbseo.php last;
            }
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  14. #14
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Here's my rewrite for the forums:

    Please try to remove this part temporarily to see if it affects those URLs:
    Code:
    location ~* i.+\.(css|js|jpg|jpeg|gif|png)$
        {
        expires      7d;
        }
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  15. #15
    Junior Member
    Real Name
    Gerald Yuvallos
    Join Date
    May 2008
    Location
    Philippines
    Posts
    28
    Liked
    1 times
    Quote Originally Posted by Oleg Ignatiuk View Post
    Gerald,

    please try to change that section to:
    Code:
            if ($request_filename ~ "\.php$" ) {
            rewrite ^(/forums/.*)$ /forums/vbseo.php last;
            }
    Works like a charm Oleg. Thanks! ^_^

    pspcrazy, like Oleg said... either let images go through vbseo or disable rewrites for images.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. howto for nginx
    By blackit in forum General Discussion
    Replies: 22
    Last Post: 08-22-2011, 02:45 AM
  2. Problem with moving posts with Nginx
    By Jim O in forum Troubleshooting
    Replies: 37
    Last Post: 05-24-2011, 07:46 AM
  3. nginx+vbseo, the forum can't merge threads?
    By wangyu1314 in forum General Discussion
    Replies: 1
    Last Post: 08-07-2008, 11:00 AM
  4. nginx
    By fras in forum General Discussion
    Replies: 3
    Last Post: 01-25-2008, 07:57 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
  •