Problems with mod_rewrite

Having trouble installing serendipity?
Post Reply
Guest

Problems with mod_rewrite

Post by Guest »

Hi

Whenever I try to use mod_rewrite I get a 404 Not Found from apache.
The mod_rewrite module IS loaded and working.

Here are my configurations:
httpd.conf:
<Directory />
Options SymLinksIfOwnerMatch
AllowOverride All
</Directory>
.htaccess
# BEGIN s9y
ErrorDocument 404 /blog2/index.php
DirectoryIndex /blog2/index.php
php_value session.use_trans_sid 0
php_value register_globals off

RewriteEngine On
RewriteBase /blog2/
RewriteRule ^archives/([0-9]+)\.html index.php?url=/archives/$1.html [L,QSA]
RewriteRule ^archives/([0-9]+)[_\-]short\.html index.php?url=/archives/$1-short.html [L,NC,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^admin$ serendipity_admin.php [L,QSA]
RewriteRule ^entries$ serendipity_entries.php [L,QSA]
RewriteRule ^archive$ index.php?url=/archive [L,QSA]
RewriteRule ^categories/([0-9]+) index.php?url=/categories/$1 [L,QSA]
RewriteRule ^(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$ rss.php?file=$1&ext=$2
RewriteRule ^plugin/(.*) index.php?url=plugin/$1 [L,QSA]
RewriteRule ^index\.(html?|php.?) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
And this is the result when trying to click on ANY link:
Not Found
The requested URL /blog2/entries was not found on this server.
The blog can be found here:
http://83.227.24.54/blog2/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problems with mod_rewrite

Post by garvinhicking »

Could you please post the output of a phpinfo() script somewhere?

Did you check your error logs? Alternatively, insert

Code: Select all

RewriteLog /blog2/rewrite.log
RewriteLogLevel 5
to your htaccess to create a logfile for why mod_rewrite is not catching for you.

Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

Thanks for the quick help.
However. After adding the log-settings to .htaccess and tried to surf the page the rewrite.log was neither created nor full of content (after creating it manually).

The phpinfo can be found here: http://83.227.24.54/phpinfo.php
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

If that file was not created or filled, that simply means you don't have mod_rewrite loaded activated for your VirtualHost...Please go through your Apache Server setup and put the RewriteEngine On and RewriteLog, RewriteLogLevel commands into the virtualhost container...
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

I followed a turtorial I found that explained how to enable mod_rewrite on my machine.

The howto can be found at http://www.tutorio.com/tutorial/enable- ... -on-apache

The outcome of this was that mod_rewrite is installed and enabled.
Here is the result of the turt. http://83.227.24.133/rewrite-testfolder/

Note the new IP


The blog that isn't working is on this address now:
http://83.227.24.133/blog2/

Any ideas why it doesn't work?

I'm running Apache 1.3.26 on a Debian box.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hm, the IP seems to be down. But the thing is this: If it is installed and enabled, the RewriteLog directive would get interpreted and the logfile created...did you double-check that your 'rewrite-testfolder' is equall to the blog2 subdirectory in your httpd.conf configuration? No different settings for the two paths?

Regards
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply