Recent Topics

1 Feb 02, 2007 11:07    

I have set up a blog and activated extra-path info, using stub files.

A typical blog URL looks like

http://www.insiderweblog.com/business


This work fine. However, my permalinks, looking like this:

http://www.insiderweblog.com/business/2007/02/01/agloco_the_next_internet_revolution


returns "The webpage cannot be found" error, as does the trackback link

http://www.insiderweblog.com/business/2007/02/01/agloco_the_next_internet_revolution#trackbacks

.

My .htaccess looks like this

# Apache configuration for the blog folder

RewriteEngine On
Options +FollowSymlinks

# 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>


# this will make register globals off in b2's directory
# just put a '#' sign before these three lines if you don't want that
<IfModule mod_php4.c>
	php_flag register_globals off
</IfModule>


# Replace "u/" with whatever your Stub Storage Folder is called in Autoblog Plugin.
# Example: "mystorage/"

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)(/(.*))?$ /u/$1/index.php/$3 [L]

# If you're using Apache 2, you may wish to try this for clean URLs:
# AcceptPathInfo	On

Being a total illitterate in making .htaccess files I would appreciate any pointers to where the problem might be. Thanks in advance.

2 Feb 02, 2007 11:11

I know it's not pretty, but my stub files are always stubname.php and I include the .php part in the Blog settings tab place where I tell it what my stub file name is.

3 Feb 02, 2007 11:36

Hi

That did not seem to help.

http://www.insiderweblog.com/science.php/2007/02/01/bullet_hits_apple

Still same problem. Is this a skin related problem? Or is it .htaccess?

*Desperate* :)

4 Feb 02, 2007 12:34

Are you using the autoblog plugin? A line in your .htaccess looks like you are is why I ask. I suggest removing that bit from your .htaccess for a bit and see if it helps because there is nothing "extra" in your url. I therefore have to wonder if your .htaccess is making a good link turn into a bad one? Also the other way around could be possible. Or perhaps you've changed autoblog from "u" as a directory to something else and did not make the corresponding change in the .htaccess file?

5 Feb 02, 2007 14:09

I installed autoblog, but then deactivated it because I won't need it. I use 'u' for stub files. I will try removing the autoblog lines from the .htaccess.

Thanx for the help!

6 Feb 02, 2007 14:37

Update:

http://www.insiderweblog.com/science.php?title=bullet_hits_apple&more=1&c=1&tb=1&pb=1

works when i turn off the extra-path info in the settings. I have put the stub files in my root and now the .htaccess looks like this:

RewriteEngine On
Options +FollowSymlinks

# 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>


# this will make register globals off in b2's directory
# just put a '#' sign before these three lines if you don't want that
<IfModule mod_php4.c>
	php_flag register_globals off
</IfModule>

But when I turn extr path-info back on, the permalinks wont work:

http://www.insiderweblog.com/science/2007/02/01/bullet_hits_apple

will give a 404...

I'm lost what to do next...

7 Feb 02, 2007 14:47

Try adding this to the end of your .htaccess

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule .*      /index.php [L]

¥

8 Feb 02, 2007 15:01

Arrgh, no luck :(

I feel like I'm missing some detail here...

Why would

http://www.insiderweblog.com/science?title=bullet_hits_apple&more=1&c=1&tb=1&pb=1

work, but not

http://www.insiderweblog.com/science/2007/02/01/bullet_hits_apple

I don't get it.

Current .htaccess:

RewriteEngine On
Options +FollowSymlinks

# 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>


# this will make register globals off in b2's directory
# just put a '#' sign before these three lines if you don't want that
<IfModule mod_php4.c>
	php_flag register_globals off
</IfModule>

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule .*      /index.php [L]

Other settings:

9 Feb 02, 2007 15:26

Ok some more info that might help(?)

php.ini:

allow_url_fopen = on

display_errors = Off
register_globals = Off

expose_php = Off
memory_limit = 25165824
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

[Zend]
zend_extension=/usr/local/zo/ZendExtensionManager.so
zend_extension=/usr/local/zo/4_3/ZendOptimizer.so

My host assures us:

Mod_rewrite is an Apache web server module installed on all of our Linux servers by default; it does not have to be installed or enabled. Our Linux hosting accounts support most mod_rewrite functionality. Mod-rewrite manipulates browser-submitted URLs and translates them to deliver content to the browser.

They also say:

NOTE:The .htaccess file containing the rewrite rules must be in the same directory as the target files.

I have my .htaccess in the root. Should I move it? b2e is installed in the root.

12 Feb 05, 2007 09:59

Hmm, applying those fixes does not seem to change anything. I'm starting to think that I'm doing something very wrong.

Is there a way to tell for sure that the MOD_REWRITE works? changes to .htaccess does not seem to do much... :(

13 Feb 05, 2007 11:35

Ok, use this as your .htaccess

Options -Indexes
deny from all

Then try to use your blog, if you can then the .htaccess isn't running.

14 Feb 05, 2007 14:17

That shut down all access to the site, so it appears to be running...

15 Feb 05, 2007 16:12

¥åßßå wrote:

*edit*
for a laugh, delete science.php (or just rename it to something else)

What happens if you delete/rename it? Do you still get the same error message?

¥

16 Feb 05, 2007 16:29

With my one, did you get rid of your stub files as you would not need them with that solution? And do the Explicit Reference Type in the blog settings as "Explicit reference on index.php"

18 May 16, 2007 11:43

I have noticed that some rewrites cause problems with B2Evolution but others don't.

Below are the rewrite rules we have in place that relate to the B2Evo blogs. The ones with a following [R] cause 404s without the [R] but work fine with it. All the others work fine as they are.

RewriteRule ^/news/vulture/?$ /blog/index.php?blog=10 [NC,QSA,L]
RewriteRule ^/artists/toomuchinformation/?$ /blog/index.php?blog=11 [NC,QSA,L]
RewriteRule ^/magazine/?$ /blog/index.php?blog=8 [NC,QSA,L]
RewriteRule ^/blog/?$ /blog/index.php?blog=1 [NC,QSA,L]
RewriteRule ^/awards/blog/backstage/?$ /blog/index.php?blog=5 [R,NC,QSA,L]
RewriteRule ^/awards/blog/indierave/?$ /blog/index.php?blog=13 [R,NC,QSA,L]
RewriteRule ^/awards/blog/indierock/?$ /blog/index.php?blog=12 [R,NC,QSA,L]
RewriteRule ^/newmusic/radar/?$ /blog/index.php?blog=15 [NC,QSA,L]

The order of the rules doesn't seem to matter as you can see that the last one works so there can't be another rules in the middle that breaks all the ones below it.

One thing I did notice was that all the ones that break have three levels of "directories" whereas all the ones that work have two or less levels.

eg.
/awards/blog/indierave/ looks like a folder three levels deep but breaks unless we redirect.
/newmusic/radar/ looks like a folder two levels deep and works fine with the rewrite.

My guess is that the B2Evo code is using $_SERVER['REQUEST_URI'] or something similar and possibly has a regex that doesn't match the third level of folders. That is, however, just a guess as I haven't looked at the code at all.

Let me know if you want me to clarify any of this.

Good luck finding this one.
Dave.


Form is loading...