Recent Topics

1 Jul 24, 2008 02:33    

My b2evolution Version: 2.4.2

I'm having trouble setting up a re-direct, and I'm beginning to suspect it stems from how I have installed b2e. (Yes, I've uncommented the last lines of .htaccess, and tried some variants on those lines as suggested in these forums.)

I want to use a few blogs as "pages" inside a website that also has non-blog pages. The blog pages are not the designated "entry" to the site. So I want urls like www.mysite.com/thisblog/ or www.mysite.com/thatblog/, just like www.mysite.com/someotherpage/.

What I've got is www.mysite.com/blogs/index.php/blog=8 or www.mysite.com/blogs/index.php/thisblog.

Here's how I've got things installed:

mysite.com/public_html/blogs

I've tried putting a copy of .htaccess in blogs, in public_html, and finally in mysite.com--with no success. I got 404 not found errors, and now (with the copy in mysite.com) 500 internal server errors. (I'm using BlueHost, with apparently up-to-date Apache, etc.)

So: could this be nested wrong, installed wrong?

Or maybe I could do a specific reconfigure in .htaccess for each specific blog--but I'd need help with the syntax to do that.

OR maybe I should go to the BlueHost control panel and just redirect the blog address, like any other redirect handled through the control panel?

2 Jul 24, 2008 03:44

Ok, I went and tried the stub file approach. Looks like the .htaccess redirect replaces that? or not?

a_stub.php starts with the comment "THIS IS ACTUALLY A DUPLICATE OF blog1.php . We leave this file here because some ancient doc still refers to it." And yet there is an explanation under "docs" for stub files--and it claims to pertain to version 2.4.

ARE THESE BOTH LIVE OPTIONS to "redirect" the blog in the way described above? Do you need BOTH? or how do you choose?

3 Jul 24, 2008 09:05

Question: Is your host running Apache? Because if it is running Microsoft IIS or something else, no matter how much you fiddle with .htaccess you will not achieve anything. Since you don't say...

Second: It would be helpful to see the actual contents of your .htaccess to determine what's wrong with it, if anything. Otherwise it's just guesswork.

Third, Stubs. You define the stub filename in the Blog Settings, URLs tab of the backoffice. There, were it says BLog URL, you select for "Blog base URL" Relative to baseurl:http://www.mysite.com/thisblog.php in your example.

You then copy blog1.php into thisblog.php and modify the contents to match the blog ID and other parameters you might want to change.

4 Jul 24, 2008 16:47

Is your host running Apache? ...Since you don't say...

I DO say, in first message: BlueHost is running "apparently up to date" Apache--turns out, Apache version 2.2.9 (Unix).

the actual contents of your .htaccess...

I'm now back to contents of sample.htaccess from "Blogs" folder downloaded with b2e 4.2.4, with the four lines near the end that start "Rewrite.." uncommented:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php

Do I ALSO need to do the stub-file routine, or are the stub-file and the .htaccess ALTERNATE procedures to accomplish redirection?

5 Jul 24, 2008 17:08

OK, my fault, I didn't see it. Sorry.

I think your last line should read:


RewriteRule .*  index.php [L]

At least that's the way I have it and it works.

Re your second question, the stub file route and the .htaccess route are independent ways to achieve similar goals. And they can be complemented also, for example, to hide the .php in your URLs.

6 Jul 27, 2008 05:24

OK, I tried that last line: still no-go.

Here's my file:

# Apache configuration for the blog folder
# Lines starting with # are considered as comments.

# PHP SECURITY:
# this will make register globals off in the evo directory
<IfModule mod_php4.c>
	php_flag register_globals off
</IfModule>
<IfModule mod_php5.c>
	php_flag register_globals off
</IfModule>

# PHP5
# This may need to be in each folder:
# AddHandler application/x-httpd-php5 .php

# CLEAN URLS:
# If you're using Apache 2, you may wish to try this if clean URLs don't work:
# AcceptPathInfo	On


# DEFAULT DOCUMENT TO DISPLAY:
# this will select the default blog template to be displayed
# if the URL is just .../blogs/
<IfModule mod_dir.c>
	DirectoryIndex index.php index.html
</IfModule>


# CATCH EVERYTHING INTO B2EVO:
# The following will allow you to have URL right off the site root,
# using index.php as a stub but not showing it.
# This will add support for URLs like:  http://example.com/2006/08/29/post-title
# Redirect anything that's not an existing directory or file to index.php
#
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^  index.php
RewriteRule .*  index.php [L] 

It is located at mysite.com/public_html/blogs

In the admin window, under blog settings > url, I choose "absolute url" and enter http://www.mysite.com/thisblog/ or http://www.mysite.com/thisblog.php

404.

Advice?

7 Jul 31, 2008 03:15

Here's what I would try:

redirect /thisblog /blog1.php
redirect /thatblog /blog2.php
redirect /otherblog /blog3.php

That is if what you want to have happen is this:

Someone enters www.example.com/thisblog into their browser and they get redirected to www.example.com/blog1.php

(I think this requires mod_alias)

Good luck and let us know how it goes.

8 Jul 31, 2008 05:22

Here's the answer to the first post

To make links like mysite.com/blog1/ or mysite.com/otherblog/ mysite.com/blog99/ use this code

# Add new blogs here!
# If the subject/extrapath does not match an existing file, call b2evo!
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(blog1|otherblog|blog99)(/.*)?$  $1.php

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^  index.php

- Create a stub file for each blog blog1.php, otherblog.php, blog99.php
- In Blog settings -> URLs use Absolute urls like http://mysite.com/blog1/ without ending .php

Good luck


Form is loading...