Results 1 to 8 of 8

Redirecting Custom Rewrites outside forum folder

This is a discussion on Redirecting Custom Rewrites outside forum folder within the Bug Reporting forums, part of the vBSEO SEO Plugin category; <not 100% sure if this is a bug or a missing feature> One of the really nice features of VBSEO ...

  1. #1
    Senior Member
    Real Name
    vissa
    Join Date
    Aug 2005
    Location
    CA, USA
    Posts
    154
    Liked
    1 times

    Question Redirecting Custom Rewrites outside forum folder

    <not 100% sure if this is a bug or a missing feature>

    One of the really nice features of VBSEO for things that lie within the forum folder is to automatically 301 redirect the old links to the new ones. This servers 2 purposes 1) not to have duplicate content and 2) possibly forward PR value with Google.

    My vbagallery lies in /pictures/ and my forum lies in /forums/

    I've written some custom rewrite rules for the programs within /pictures/ (browseimages.php and showimages.php) that seem to work pretty well. The problem is, if I type one of the old URLs in my browser, it doesn't 301 redirect. It just displays the old page url. All the old links within the forum have their links rewritten properly and it works when it goes to the rewritten url, but I would like to have these old spidered pages 301 redirect. Is this currently possible (outside forum folder), a missing feature, a bug, etc?


    Here is my public_html/.htaccess file (taken from Oleg's post#118 in Custom rewrite for vBA Photogallery & Links?)

    ErrorDocument 401 /401.html
    ErrorDocument 403 /403.html
    ErrorDocument 404 /404.html
    ErrorDocument 500 /500.html
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !forums/
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ forums/vbseo.php?vbseourl=$1&vbseorelpath=../&%{QUERY_STRING} [L]
    Here are some of my custom rewrites relavent to this
    'browseimages\.php\?c=(\d+)$' => 'cat-$1.html'
    ...
    'browseimages\.php\?do=popimages&orderby=posts' => 'toppost.html'
    ...
    'showimage\.php\?i=(\d+).*$' => 'photo-$1.html'
    '/pictures/index\.php' => '/pictures/'
    Thanks
    -vissa
    Last edited by vissa; 03-05-2006 at 08:42 PM.

  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 vissa,

    you may need to add the following to redirect old urls automatically:
    RewriteCond %{REQUEST_FILENAME} !forums/
    RewriteRule ^(.*\.php)$ forums/vbseo.php?vbseourl=$1&vbseorelpath=../&%{QUERY_STRING} [L]
    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
    Senior Member
    Real Name
    vissa
    Join Date
    Aug 2005
    Location
    CA, USA
    Posts
    154
    Liked
    1 times
    That caused all kinds of errors for me.
    What happened when I typed an old gallery URL is it directed to the root instead of the picture gallery.

    Example URL: http://website/pictures/browseimages.php?c=12

    redirected to http://website/cat-12.html
    instead of http://website/pictures/cat-12.html

    which caused vbseo errors.

    Thanks for your help
    -vissa

  4. #4
    Senior Member
    Real Name
    vissa
    Join Date
    Aug 2005
    Location
    CA, USA
    Posts
    154
    Liked
    1 times
    Which reminds me -- is there a way to make vbseo behave better when there is a problem with custom rewrites? It always outputs a blank white page with php errors (that disclose more that I'd like). Perhaps this could be a feature request for the future. My website has custom 404/etc errors but these aren't triggered with vbseo.

    -vissa

  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    PM sent
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  6. #6
    Senior Member
    Real Name
    vissa
    Join Date
    Aug 2005
    Location
    CA, USA
    Posts
    154
    Liked
    1 times
    PM going back.

    I just want to say that custom rewrites OUTSIDE/ABOVE the forum folder are extremely dangerous and somewhat buggy/poorly implemented in my opinion. I'm pretty upset right now because I just discovered that after applying the .htaccess noted in my first post (to rewrite gallery pictures), other things (such as my old UBB forum archive) were totally screwed up and started redirecting to my vbulletin forum. I didn't notice this until today. The old UBB archive forum was responsible for a significant amount of adsense revenue and who knows what the search engines will do now that they have been indexing new/bad content.

    Needless to say I've removed the custom .htaccess given in my first post and lost my custom photo rewrites for now. It's really dangerous. Perhaps if it could be targeted toward specific folders instead of everything in/below root.

    -vissa
    Last edited by vissa; 03-10-2006 at 01:46 PM.

  7. #7
    Senior Member
    Real Name
    vissa
    Join Date
    Aug 2005
    Location
    CA, USA
    Posts
    154
    Liked
    1 times
    OK I had to trash the .htaccess you said to put in root. Please don't take it the wrong way, but I really don't think you should tell anyone to use that because it can really cause a lot of problems. Better to use different .htaccess files in each folder for each program/folder that needs rewriting by vbseo.

    What I ended up doing is
    within /pictures/.htaccess
    Code:
     
    RewriteEngine On
    RewriteCond %{QUERY_STRING} !vbseourl=
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$  /forums/vbseo.php?vbseourl=$1&vbseorelpath=../pictures/&%{QUERY_STRING} [L]
    RewriteCond %{REQUEST_FILENAME} !forum/
    RewriteRule ^(.*\.php)$ /forums/vbseo.php?vbseourl=$1&vbseorelpath=../pictures/&%{QUERY_STRING} [L]
    using the same vbseo CRRs.

    If you put the .htaccess in root like you mentioned in a post, ANY URL that fits a rewrite defined in vbseo (including the built in options for forums, threads, etc) will get rewritten. That can really wreak havoc on big sites with lots of files because I found many that were being rewritten without my knowledge or wanting them to be.

    By the way, the last line in the code above fixed the 301 redirect problem that I originally created this thread about.

    -vissa

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

    thank you for the follow-up!
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Similar Threads

  1. Help moving from root folder to forum folder.
    By Amos in forum General Discussion
    Replies: 4
    Last Post: 01-29-2006, 10:20 PM
  2. CRR Custom Rewrite Rules for root
    By vissa in forum Custom Rewrite Rules
    Replies: 1
    Last Post: 12-05-2005, 11:18 AM

Posting Permissions

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