Recent Topics

1 Jun 21, 2011 10:45    

My b2evolution Version: 3.3.3

I am switching to a different host and I thought it would be a good idea to do some changes in the organization of my site layout.

At the moment I have this:[list]

  • All b2evo files and directories are in /

  • The blog is accessed as site.com

  • [/list:u]

    Given that I have other sites on the same hosting, I would like to keep b2evo in a separate subdirectory, so that my / does not look like a mess.

    What I want to achieve is this:[list]

  • All b2evo files and directories are in /__b2evo

  • The blog is accessed as site.com (not site.com/__b2evo)

  • [/list:u]

    There are several things that I am worried about:[list]

  • Will my old URLs work?

  • Some of the posts have images the path to which was absolute, ex: site.com/media/blogs/a/image.png. These links will become broken, so I plan to update them using an SQL query.

  • [/list:u]

    Having read this article: http://manual.b2evolution.net/Call_a_blog_from_a_subdirectory, I concluded that I need to do the following:[list=1]

  • Copy b2evo's files to to /__b2evo

  • Copy index.php to /

  • Change index.php "require_once dirname(__FILE__).'/conf/_config.php';" to "require_once dirname(__FILE__).'/__b2evo/conf/_config.php';"

  • [/list:o]

    I am wondering about the following:[list=a]

  • Is the scenario I described in the beginning possible?

  • Are there any other side effects besides the ones I am aware of?

  • Is there a way to deal with the wrong paths to images without relying on SQL queries? I prefer not to interfere with the database because I am not fully aware of the relationships between the tables in the database schema - so I think this is a place where I can easily screw something up :-)

  • Is the proposed solution reasonable?

  • [/list:o]

    2 Jun 23, 2011 10:07

    Is the scenario I described in the beginning possible?
    Are there any other side effects besides the ones I am aware of?

    If you want to keep old links to media files use rewrites in .htaccess
    /media > /__b2evo/media
    This is easier than edit the database even if you don't care about image links.

    Is there a way to deal with the wrong paths to images without relying on SQL queries? I prefer not to interfere with the database because I am not fully aware of the relationships between the tables in the database schema - so I think this is a place where I can easily screw something up :-)

    Simple replace query in evo_items__item table will not do any harm to b2evo structure as long as you only edit post_content.

    A drawback is you will see b2evo admin, skin files and /rsc files in /__b2evo subdirectory. If you want to completely hide /__b2evo path rewrite all requests with .htaccess, you'll find lots of manuals about it in google

    3 Jul 25, 2011 19:16

    Thank you for the quick response; I'm sorry for not reacting earlier (life threw me some undocumented exceptions).

    The method described above works, but there are some side effects I did not consider. What happens is that the page opens and the stuff is rendered correctly, but if I try to post a comment - some files cannot be found.

    I figured that the base_url needs to be changed too, so there's a new step in those instructions:

    1. Copy b2evo's files to to /__b2evo

    2. Copy index.php to /

    3. Change index.php "require_once dirname(__FILE__).'/conf/_config.php';" to "require_once dirname(__FILE__).'/__b2evo/conf/_config.php';"

    4. Change basic_config.php "$baseurl = 'http://site.net/';" into $baseurl = 'http://site.net/__b2evo/';

    5. [/list:o] After that, everything works, but there is a side effect: all the URLs have "__b2evo" in them, so all the old links are broken.

      If you want to keep old links to media files use rewrites in .htaccess

      Indeed, I forgot about mod_rewrite, thank you for the suggestion. Here is the .htaccess I am using, it is placed in the root directory of my site (where I now copied index.php from /__b2evo)
      
      RewriteEngine On
      #RewriteLog   "~/tmp/rewrite.log"
      #RewriteLogLevel 3
      RewriteRule (.*)/media/(.*) $1/__area51/media/$2
      
      However, it does not work. Hmmm... The mod_rewrite log is not created either, so I am a bit puzzled. Further assistance will be greatly appreciated.


    Form is loading...