Forum Moderators: phranque

Message Too Old, No Replies

Big Problems with .HTACCESS and Mod Rewrite

         

naitsirhc26

7:32 am on Sep 1, 2007 (gmt 0)

10+ Year Member



Hello,

I am using a multiple user blogging system, where anyone can sign on and get a blog hosted by my website. I am still working out the kinks and bugs before it goes public, but right now its major kink is that it won't post the posts in the blogs! I can get to the posts if I use a direct link, but the posts don't show up on the home pages, the archives link doesn't work, and the categories links don't work. They all lead to a "not found" page. At this point I am beginning to wonder if this is because I am having a problem with my .htaccess and server "talking." and maybe the server is ignoring the .htacess.

Here is my .htaccess: (which I believe has commands for mod_rewrite)

php_flag register_globals off

RewriteEngine On
RewriteBase /blogs/

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Everything SHOULD be working, but it just isn't. This is a very respected multiple user blogging system, and it works for most everyone else. Is there a setting on my server that needs to be set for the .htaccess to properly work?

Another odd thing is that when I got to manage the posts on the backend, it says that I have NO POSTS, even though I really do!

Any thoughts?

Thanks in advance,

Christian

wkczm

1:36 pm on Sep 1, 2007 (gmt 0)

10+ Year Member



Christian

I'm pretty new to apache, but am having some problems with rewrite. I don't know anything about building a blog site, but try this:

add this to .htaccess, if it starts logging (I can't get mine to work), then you should be able to debug:

Options +FollowSymLinks
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9

Warren

wkczm

7:03 pm on Sep 1, 2007 (gmt 0)

10+ Year Member



Christian,

My advice above was totally wrong. The Rewritelog directive must go under a <VirtualHost> container.

With help, I've now got my rewrite commands working partially, so again take this advice with a grain of salt, but read up on AllowOverride and try setting "AllowOveride All" under your blog directory blogs/wp-content (I believe that's your dir).

Warren

jdMorgan

7:12 pm on Sep 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's often helpful to take a step back and confirm that a simple rewrite or redirect works properly. I'd suggest:

RewriteEngine on
#
RewriteRule ^foo\.html$ http://www.google.com [R=301,L]

Request /foo.html from your server, and you should end up at google.

If that does not work, then add:


Options +FollowSymLinks

ahead of those lines, and try again after completely flushing your browser cache.

Jim

naitsirhc26

6:29 am on Sep 2, 2007 (gmt 0)

10+ Year Member



Thanks for the information. I will check these options out.

naitsirhc26

10:19 pm on Sep 2, 2007 (gmt 0)

10+ Year Member



Okay, so I found out that my host DID make it so my .htaccess works. So now I am just stuck and have no clue why these links don't work!