Recent Topics

webroot redirection: / to /b2evolution/

Started by on Aug 23, 2006 – Contents updated: Aug 17, 2017

Aug 23, 2006 23:11    

Hello!
I have installed b2evo to a subfolder named b2evolution, so my blog is availible at http://www.mydomain.eu/b2evolution

Everything works fine so far, but i want the blog to be the startpage of my domain. My aim is that www.mydomain.eu shows "Blog All" (ID1).

First i tried header redirection. I put a file index.php with the following content to the webroot.
[codeblock lang="" line="1"]<?php
header&#40;"Location&#58; http&#58;//www.mydomain.eu/b2evolution/"&#41;;
exit&#40;&#41;;
?>[/codeblock]
It works fine, but there are some disadavantages: The user sees /b2evolution/ in the browser's adress bar. Moreover i experienced problems with google indexing. My Page hasent been updated in the google search results for a few days. Im not sure if this is the right reason.

Second try: I put index.php from /b2evolution/ to the webroot and changed it slightly:
[codeblock lang="" line="1"]require_once dirname&#40;__FILE__&#41;.'/b2evolution/conf/_config.php';[/codeblock]
At the first sight this is the perfect solution, but now i cant login anymore. I have to go to /b2evolution/ in order to stay logged in. I think this has something to do with cookies.

In the end i tried redirection with mod_rewrite, but there is still the login-problem.

Your help is greatly appreciated.

Sandro

Aug 23, 2006 23:53

Move everything from your b2evolution folder up one level to your root, then change the $baseurl in your conf/_basic_config.php file to reflect the new fact (meaning remove the "/b2evolution" from it).

Aug 24, 2006 00:37

I moved everything from b2evolution up one level to the root and changed the $baseurl. It works! Thank you very much.

For people who have got the same problem:
My blog contains only a few posts, so for me there is no problem with existing permalinks. But you should consider this when changing the path in this way. Im sure you can solve this problem with mod_rewrite.

Another aspect is, that you get a complex root directory with many files and folders in it.

Aug 28, 2006 09:13

Do this if you changed URL/folder/etc in an existing site (which I recently learned):

Code

Options +FollowSymlinks
RewriteEngine On
 
RewriteBase /
 
RewriteCond %{HTTP_HOST} ^([a-z0-9-]+\.)?yourOLDdomain\.TLD$
RewriteRule (.*) http://yourNEWdomain.TLD/$1 [R=301]

It will also help the search engine to update their URLs for your blog entries as well as help you in technorati.

R=301 is HTTP 301 Permanent Redirect, which tells intelligent bots to adopt your new URL.

So anything http://yourOLDdomain.TLD/index.php/2888/12/25/TITLE will automatically be redirected to http://yourNEWdomain.TLD/index.php/2888/12/25/TITLE

If its in a subfolder just add the subfolder and it will work fine, like so:

Code

RewriteCond %{HTTP_HOST} ^([a-z0-9-]+\.)?yourdomain\.TLD/subfolder$
RewriteRule (.*) http://yourNEWdomain.TLD/$1 [R=301]

Hope that helps.


Form is loading...

multiblog platform – This forum is powered by b2evolution CMS, a complete engine for your website.