Jump to content

Archived

This topic is now archived and is closed to further replies.

windyweather

Mod_Rewrite fails - SUSE 10.1

Recommended Posts

I'm trying to get WordPress to work on Apache on SUSE 10.1. It looks like a problem with Mod_Rewrite.
I don't suspect a problem with Apache, but a problem with the config on SUSE.
But to reduce the problem to more manageable test case, I tried the following:

YAST shows REWRITE enabled.
I've restarted the server, and rebooted.

Apparently mod_rewrite is not enabled. Wordpress doesn't work with permalinks and a simple test doesn't work either.
Any tricky business that I need to know? Any suggestion for a simple test? One test I saw suggested that I would get an error on [b]RewriteEngine On[/b] if the module were not loaded. But apparently that is not the case.

Pretty much no URL is handled. For the test case below:
[url=http://localhost/test-rewrite/content.php]http://localhost/test-rewrite/content.php[/url] works as well as ... /content.php?whatever=somevalue
but
[url=http://localhost/test-rewrite/products/]http://localhost/test-rewrite/products/[/url]  gives a 404 as does
[url=http://localhost/test-rewrite/products/1123123/]http://localhost/test-rewrite/products/1123123/[/url]

I've just tried to build a simple example since wordpress is not exactly straightforward to diagnose.
So it looks like mod_rewrite is not enabled, even tho YAST says so.

[url=http://www.windyweather.net/wp/2006/08/02/apache-configuration/]Here's an archive of the entire apache config tree.[/url]

Thanks,
ww

.htaccess
[code]
Options +FollowSymLinks
AllowOverride All
RewriteEngine On

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test-rewrite/
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/products$ /test-rewrite/content.php?action=product_list [NC]
RewriteRule ^/products/([0-9]+)$ /test-rewrite/content.php?code=$1 [NC]
RewriteRule . /test-rewrite/content.php [L]
</IfModule>
[/code]

content.php
[code]
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Test MOD_REWRITE</title>

</head>
<body>

<h2>Parameter List</h2>
<?php

foreach ( $_GET as $key => $value )
{
print( "$key = $value<br>" );
}

?>

</body>
</html>
[/code]

Share this post


Link to post
Share on other sites
Ok. Looks like I solved it.
(1) Must have AllowOverride All in the <Directory> or .htaccess before rewrite rules will work.
(2) Must have Options FollowSymLinks enabled in <Directory> as well.

Sigh...

Share this post


Link to post
Share on other sites
Windy, I'm coming up against the same deal.  I have SUSE 10 and YaST says it's enabled, but even the simplest rewrite function doesn't work.

I have AllowOverride All and Options FollowSymLinks enabled in <directory>.

I've actually got a thread going on another site: http://forums.devnetwork.net/viewtopic.php?p=362883

If you could help that would be great.

Share this post


Link to post
Share on other sites
Bill_VA,

I'm no expert.. I solved my problem by doing (1) and (2) above...
I suggest you carefully compare the config that I posted as an archive - follow above link - with yours, and then make the (1) and (2) changes.
Sorry, but I don't have any more to add.

Good luck.
ww

Share this post


Link to post
Share on other sites
ww,

That did it, I just replaced my Apache files with yours, made some edits, and I'm good to go.  I wish I had the time to figure out what it was.

Thanks again!!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.